KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jdo > spi > persistence > support > sqlstore > PersistenceCapable


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 /*
25  * PersistenceCapable.java
26  *
27  * Created on February 28, 2000
28  */

29  
30 package com.sun.jdo.spi.persistence.support.sqlstore;
31
32
33 /**
34  * Internal PersistenceCapable interface.
35  */

36 public interface PersistenceCapable
37     extends com.sun.jdo.api.persistence.support.PersistenceCapable
38 {
39     /**
40      * Returns the associated state manager.
41      */

42     StateManager jdoGetStateManager();
43
44     /**
45      * Sets the associated state manager.
46      */

47     void jdoSetStateManager(StateManager sm);
48
49     /**
50      * Returns the value of the JDO flags.
51      */

52     byte jdoGetFlags();
53
54     /**
55      * Sets the value of the JDO flags, and returns the previous value.
56      */

57     void jdoSetFlags(byte flags);
58
59     /**
60      * Returns the value of the specified field.
61      *
62      * Primitive valued fields are wrapped with the corresponding
63      * Object wrapper type.
64      */

65     Object JavaDoc jdoGetField(int fieldNumber);
66
67     /**
68      * Sets the value of the specified field.
69      *
70      * Primitive valued fields are wrapped with the corresponding
71      * Object wrapper type.
72      */

73     void jdoSetField(int fieldNumber, Object JavaDoc value);
74
75     /**
76      * Creates an instance of the same class as this object.
77      */

78     // added new method
79
Object JavaDoc jdoNewInstance(StateManager statemanager);
80
81     /**
82      * Clears the fields of each persistent field.
83      *
84      * This method stores zero or null values into each persistent
85      * field of the instance, in effect reverting it to its initial
86      * state. Clearing fields allows objects referred to by this
87      * instance to be garbage collected. The associated StateManager
88      * calls this method when transitioning an instance to the hollow
89      * state. This will normally be during post completion.
90      */

91     // removed parameter: StateManager sm
92
void jdoClear();
93
94     /**
95      * Copies values from each transient, derived, or persistent field
96      * from the target instance.
97      *
98      * The target instance must have exactly the same type as this instance.
99      *
100      * This method might be used by the StateManager to make a shallow
101      * copy of an instance, or might be used to restore values of an
102      * instance after transaction rollback. It might be used by the
103      * application to make a shallow copy (clone) of a transient or
104      * persistent instance.
105      *
106      * The enhancement-added fields (jdoFlags and jdoStateManager) are not
107      * affected by jdoCopy().
108      */

109     //@olsen: fix 4435059: this method is not generated anymore
110
// additional parameter: boolean cloneSCOs
111
//void jdoCopy(Object o, boolean cloneSCOs);
112
}
113
Popular Tags