SingleFieldIdentity
java.lang.Object
∟ javax.jdo.identity.SingleFieldIdentity
- Implemented Interfaces:
Comparable
,Externalizable
,Serializable
This class is the abstract base class for all single field identity classes. A common case of application identity uses exactly one persistent field in the class to represent identity. In this case, the application can use a standard JDO class instead of creating a new user-defined class for the purpose.
- Since:
- JDO 1.0
Public Constructors
- Since:
- JDO 2.0
Public Methods
boolean equals(Object obj)
If restored from serialization, class will be null so compare class name.
- Parameters:
obj
- the other object
- Return:
- true if the class or class name is the same
- Since:
- JDO 1.0
Object getKeyAsObject()
The method is synchronized to avoid race conditions in multi-threaded environments.
- Return:
- the key as an Object.
- Since:
- JDO 2.0
Class getTargetClass()
- Return:
- the target class.
- Since:
- JDO 2.0
String getTargetClassName()
- Return:
- the target class name.
- Since:
- JDO 2.0
int hashCode()
- Return:
- the cached hash code.
- Since:
- JDO 1.0
void readExternal(ObjectInput in)
Creates a new instance with the target class name set
- Since:
- JDO 1.0
void writeExternal(ObjectOutput out)
- Parameters:
out
- the stream
- Since:
- JDO 1.0