1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package javax.jdo.spi;
18
19 /***
20 * This interface is implemented by classes that can be detached from the
21 * persistence context and later attached. The interface includes the
22 * contract by which the StateManager can set the object id, version,
23 * BitSet of loaded fields, and BitSet of modified fields
24 * so they are preserved while outside the persistence environment.
25 * <P>The detached state is stored as a field in each instance of Detachable.
26 * The field is serialized so as to maintain the state of the instance
27 * while detached. While detached, only the BitSet of modified fields
28 * will be modified. The structure of the Object[] jdoDetachedState
29 * is as follows:
30 * <ul><li>jdoDetachedState[0]: the Object Id of the instance
31 * </li><li>jdoDetachedState[1]: the Version of the instance
32 * </li><li>jdoDetachedState[2]: a BitSet of loaded fields
33 * </li><li>jdoDetachedState[3]: a BitSet of modified fields
34 * </li></ul>
35 * @version 2.0
36 */
37
38 public interface Detachable {
39
40 /*** This method calls the StateManager with the current detached
41 * state instance as a parameter and replaces the current detached
42 * state instance with the value provided by the StateManager.
43 * @since 2.0
44 */
45 public void jdoReplaceDetachedState();
46 }