KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > versant > core > jdo > VersantDetachable


1
2 /*
3  * Copyright (c) 1998 - 2005 Versant Corporation
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  * Versant Corporation - initial API and implementation
11  */

12 package com.versant.core.jdo;
13
14 import javax.jdo.spi.PersistenceCapable;
15
16 /**
17  * A class that can be detached by a JDO Genie implementation
18  * must implement this interface.
19  */

20 public interface VersantDetachable extends PersistenceCapable {
21
22     /**
23      * Tests whether this object is dirty.
24      * <p/>
25      * Instances that have been modified or newly made persistent
26      * return <code>true</code>.
27      *
28      * @return <code>true</code> if this instance has been modified.
29      * @see PersistenceCapable#jdoMakeDirty(String fieldName)
30      */

31     public boolean versantIsDirty();
32
33     /**
34      * Tests whether this field is dirty.
35      *
36      * @param fieldNo the field no in the metadata
37      */

38     public boolean versantIsDirty(int fieldNo);
39
40     /**
41      * Mark the associated field dirty.
42      *
43      * @param fieldName the name of the field
44      */

45     public void versantMakeDirty(String JavaDoc fieldName);
46
47     /**
48      * Mark the associated field dirty.
49      *
50      * @param fieldNo the field no in the metadata
51      */

52     public void versantMakeDirty(int fieldNo);
53
54     /**
55      * Return <code>true</code> if the field is cached in this instance.
56      *
57      * @param fieldNo the field no in the metadata
58      * @return whether the field is cached in the calling instance
59      */

60     public boolean versantIsLoaded(int fieldNo);
61
62     /**
63      * Marks the the field as cached in this instance.
64      *
65      * @param fieldNo the field no in the metadata
66      */

67     public void versantSetLoaded(int fieldNo);
68
69     /**
70      * Sets the object representing the JDO identity of this instance.
71      */

72     public void versantSetOID(Object JavaDoc oid);
73
74     /**
75      * Return the object representing the JDO identity of this instance.
76      *
77      * @return the object representing the JDO identity of this instance
78      */

79     public Object JavaDoc versantGetOID();
80
81     /**
82      * The value of the version field on the pc.
83      */

84     public void versantSetVersion(Object JavaDoc version);
85
86     /**
87      * The value of the version field on the pc.
88      * This will return null if there are no version fields.
89      */

90     public Object JavaDoc versantGetVersion();
91
92     /**
93      * The VersantDetachedStateManager for this class.
94      * If the StateManager is not of type VersantDetachedStateManager then null is returned.
95      * The VersantDetachedStateManager is used to keep track of deleted objects.
96      *
97      * @return the StateManager if it is a VersantDetachedStateManager
98      */

99     public VersantDetachedStateManager versantGetDetachedStateManager();
100
101 }
102
Popular Tags