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