public abstract class JPAObject extends Object implements Cloneable, Comparable<JPAObject>, Serializable
JDO Object
classes will be derived. Provides default implementations for
common methods.
© Copyright 2007, Sans Pareil Technologies, Inc.
| Modifier and Type | Field and Description |
|---|---|
protected int |
hash
The integer that represents the hash code for this object.
|
protected static int |
HASH
The default value to use for
hash. |
protected static Logger |
logger
The logger to use to log errors or messages to.
|
protected Long |
oid
The object id (primary key) for the object instance.
|
protected StartLetter |
startLetter
The start letter for the primary string identifier for the object.
|
| Modifier | Constructor and Description |
|---|---|
protected |
JPAObject()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
clone()
Creates and returns a copy of this object.
|
int |
compareTo(JPAObject object)
Compares this object with the specified object for order.
|
protected static com.thoughtworks.xstream.XStream |
createXStream()
Return the utility used to convert the object to and from XML
representation.
|
boolean |
equals(Object object)
Default implementation of equality checking.
|
static JPAObject |
fromXML(String xml)
Parse the object out of the XML representation of this object.
|
Object |
getObjectId()
Return the
ObjectId of this persistent instance. |
StartLetter |
getStartLetter()
Returns
startLetter. |
int |
hashCode()
Default computation of a hash code for the object.
|
void |
jdoPostLoad()
InstanceCallbacks method implementation.
|
void |
jdoPreDelete()
InstanceCallbacks method implementation.
|
void |
jdoPreStore()
InstanceCallbacks method implementation.
|
protected void |
resetHash()
Reset the
hash value. |
String |
toString()
Return a string representation of this object.
|
String |
toXML()
Return an XML representation of the fields of this object.
|
protected static final Logger logger
protected static final int HASH
hash.protected int hash
protected Long oid
protected StartLetter startLetter
Note: Instances of StartLetter are shared across
multiple instances and hence need to be maintained separately. In
particular obsolete instances of this class need to be cleaned up when
deleting instances of JPAObject. Obsolete instances are
created when the current entity is the only instance associated with
a particular StartLetter.
public String toString()
public Object clone() throws CloneNotSupportedException
Cloneable interface. No special actions are
performed. This method simply allows public access to the
Object.clone method.clone in class ObjectCloneNotSupportedException - If the super-class implementation
throws an error.public boolean equals(Object object)
ObjectId.
If this instance is transient, then the super-class
implementation of equals is used.
Note: Sub-classes are encouraged to over-ride this method if special equality checking rules are desired.
public int hashCode()
ObjectId. If the instance if
transient return the value as obtained from the
super-class implementation.public int compareTo(JPAObject object)
Note: The default implementation just compares the
hashCode() values. It is recommended that sub-classes
over-ride this method for appropriate sort order.
compareTo in interface Comparable<JPAObject>object - The object that is to be compared with this object.protected static com.thoughtworks.xstream.XStream createXStream()
toXML()
and fromXML(java.lang.String) methods to initialise the serialiser in a
standard manner.public String toXML()
Note: Currently this method uses the XStream API to convert the object into XML. This may be modified at a later date to convert into a TMS standard XML format.
createXStream(),
fromXML(java.lang.String)public static JPAObject fromXML(String xml)
xml - The XML representation of this object.createXStream(),
toXML()protected void resetHash()
hash value.public Object getObjectId()
ObjectId of this persistent instance.ObjectId of this instance. Returns
null if this instance is transient.public StartLetter getStartLetter()
startLetter.public void jdoPostLoad()
public void jdoPreStore()
public void jdoPreDelete()