|
SPT Core API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sptci.jpa.JPAObject
public abstract class JPAObject
A base object from which all the JDO Object
classes will be derived. Provides default implementations for
common methods.
© Copyright 2007, Sans Pareil Technologies, Inc.
| Field Summary | |
|---|---|
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. |
| Constructor Summary | |
|---|---|
protected |
JPAObject()
Default constructor. |
| Method Summary | |
|---|---|
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 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. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
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.
| Constructor Detail |
|---|
protected JPAObject()
| Method Detail |
|---|
public String toString()
toString in class ObjecttoXML()
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.
equals in class Objectobject - The object that is to be compared for equality.
true if the specified object is
of the same type as this object and has the same ObjectId.public int hashCode()
ObjectId. If the instance if
transient return the value as obtained from the
super-class implementation.
hashCode in class Objectpublic 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 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()
|
SPT Core API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||