|
SPT Object Database API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sptci.prevayler.PrevalentObject<K>
public abstract class PrevalentObject<K>
Abstract base class whose instances are stored in the prevalent system.
At present sptodb does not support persisting other types of classes.
This restriction was introduced since we need a objectId field
in the class that can be managed by the prevalent system. Making this
an interface would not guarantee us the availability of such a field.
© Copyright 2008 Sans Pareil Technologies, Inc.
| Field Summary | |
|---|---|
private MetaData |
_sptodbMetaData
The metadata for the persistent object. |
private K |
objectId
The object id field for the instance. |
private static long |
serialVersionUID
|
| Constructor Summary | |
|---|---|
protected |
PrevalentObject()
Default constructor. |
protected |
PrevalentObject(K oid)
Create a new instance of the prevalent object with the specified object id. |
| Method Summary | |
|---|---|
Object |
clone()
Over-ridden to make publicly accessible. |
int |
compareTo(PrevalentObject prevalentObject)
Compare the specified prevalent object with this instance for ordering. |
boolean |
equals(Object object)
Compare the specified object with this instance for equality. |
(package private) MetaData |
get_sptodbMetaData()
Getter for property _sptodbMetaData. |
Date |
getCreationDate()
Return the date at which this object was created. |
Date |
getModificationDate()
Return the date at which this object was last updated in the prevalent system. |
K |
getObjectId()
Return the object id for the business object. |
abstract K |
getObjectId(String oid)
Return the objectId value that may be used to retrieve the
prevalent instance from the specified string representation. |
int |
hashCode()
Default implementation of Object.hashCode(). |
boolean |
isPersistent()
Return a flag indicating whether this instance represents a persistent instance or not. |
(package private) void |
set_sptodbMetaData(MetaData metadata)
Setter for property _sptodbMetaData. |
String |
toString()
Return a string representation of this object. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final long serialVersionUID
private K objectId
private MetaData _sptodbMetaData
PrevalentSystem when persistent operations on the object
are performed.
| Constructor Detail |
|---|
protected PrevalentObject()
protected PrevalentObject(K oid)
String.
oid - The objectId value to use.| Method Detail |
|---|
public boolean equals(Object object)
objectId. Sub-classes are strongly discouraged
from over-riding this method, since this method compares strictly based
on objectId equality. In case you need to over-ride this
method it is strongly recommended that you apply the additional rules
after having invoked this implementation.
equals in class Objectobject - The object to be compared for equality with this object.
true if the specified object is equivalent
to this object.public int hashCode()
Object.hashCode(). Over-ridden
to return the hash code based upon objectId. Similar to
equals(java.lang.Object), sub-classes are discouraged from over-riding this
default implementation.
hashCode in class Objectpublic int compareTo(PrevalentObject prevalentObject)
objectId. Sub-classes may
need to over-ride this method for special handling.
compareTo in interface Comparable<PrevalentObject<K>>prevalentObject - The object to be compared with this instance.
public String toString()
objectId.
toString in class Object
public Object clone()
throws RuntimeException
clone in class ObjectRuntimeException - If the object cannot be cloned.final MetaData get_sptodbMetaData()
_sptodbMetaData.
_sptodbMetaData.final void set_sptodbMetaData(MetaData metadata)
_sptodbMetaData.
metadata - Value to set for property _sptodbMetaData.get_sptodbMetaData()public final K getObjectId()
objectId value.public final Date getCreationDate()
public final Date getModificationDate()
public final boolean isPersistent()
true if the instance is perstent in the
prevalent system.public abstract K getObjectId(String oid)
objectId value that may be used to retrieve the
prevalent instance from the specified string representation. This is
mandated by the necessity for storing the objectId values as
String instances in the lucene index.
Note: The string value of objectId stored in the
lucene index is the value returned by Object.toString(). Your
primary key class must return a meaningful value to be able to
reconstruct the primary key instance.
oid - The string value that is to be converted to the proper objectId value.
|
SPT Object Database API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||