JDO Class

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

Constructor only for Externalizable.
Since:
JDO 2.0

Public Methods

boolean equals(Object obj)
Check the class and class name and object type.
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
Return the key as an Object.
The method is synchronized to avoid race conditions in multi-threaded environments.
Return:
the key as an Object.
Since:
JDO 2.0
Return the target class.
Return:
the target class.
Since:
JDO 2.0
Return the target class name.
Return:
the target class name.
Since:
JDO 2.0
int hashCode()
Return the cached hash code.
Return:
the cached hash code.
Since:
JDO 1.0
void readExternal(ObjectInput in)
Read from the input stream.
Creates a new instance with the target class name set
Since:
JDO 1.0
void writeExternal(ObjectOutput out)
Write to the output stream.
Parameters:
out - the stream
Since:
JDO 1.0

Method inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait