|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.groiss.store.PersistentObject
public abstract class PersistentObject
This is a default implementation of the Persistent
interface. All methods apart from Persistent.getTableName()
are implemented with default behaviour.
This abstract class also implements the KeyValuePair
interface. So persistent objects become key value pairs, where the object's
OID is the key and the object's String representation is the
value.
| Field Summary | |
|---|---|
protected boolean |
filled
|
protected long |
oid
|
| Constructor Summary | |
|---|---|
PersistentObject()
|
|
| Method Summary | |
|---|---|
Object |
clone()
|
List<Field> |
dbFields()
Returns the persistent fields of this object in a List
containing java.lang.reflect.Field objects. |
boolean |
equals(Object o)
Compares two persistent objects and returns true if they
are equal (i.e., they must have the same OID and the same class). |
Object |
getKey()
Returns the key (OID) of this KeyValuePair. |
long |
getOid()
Getter method for the persistent object's OID. |
Store |
getStore()
Returns the Store object which is responsible for storing this
persistence object. |
Object |
getValue()
Returns the value ( String representation) of this
KeyValuePair. |
int |
hashCode()
Returns a hash code for this persistent object. |
boolean |
isFilled()
With this method you check if this persistent object is filled with persistent data or not. |
void |
onDelete()
This method is called before the persistent object is deleted. |
void |
onInsert()
This method is called before the persistent object is inserted in the store. |
void |
onRead()
This method is called after the persistent object has been read. |
void |
onUpdate()
This method is called before the persistent object is updated to the store (the existing object in the store will be overwritten with the values of this object). |
void |
setFilled(boolean f)
This method can change the filled status of this persistent object. |
void |
setOid(long oid)
Setter method for the persistent object's OID. |
void |
setStore(Store store)
With this method you can change the Store of this persistent object. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.groiss.store.Persistent |
|---|
getTableName |
| Field Detail |
|---|
protected long oid
protected boolean filled
| Constructor Detail |
|---|
public PersistentObject()
| Method Detail |
|---|
public long getOid()
Persistent
getOid in interface Persistentpublic void setOid(long oid)
Persistent
setOid in interface Persistentoid - The new OID for the object.public void setFilled(boolean f)
PersistentPersistent.isFilled() for more details.
setFilled in interface Persistentf - The new value for the filled status.public boolean isFilled()
PersistentStore
to fill it.
isFilled in interface Persistenttrue if the object is filled with values, or
false if the object is empty (only OID is set).public Store getStore()
Store object which is responsible for storing this
persistence object.
getStore in interface PersistentStore of this persistent object.public void setStore(Store store)
PersistentStore of this persistent object.
Usually objects are stored in the system's database and you will never need
to set the Store manually.
setStore in interface Persistentstore - The new Store that will be set for this persistent object.public List<Field> dbFields()
List
containing java.lang.reflect.Field objects.
dbFields in interface PersistentList containing the persistent fields of this
persistent object. The List must contain the fields
as java.lang.reflect.Field objects.public void onInsert()
Persistent
onInsert in interface Persistentpublic void onUpdate()
Persistent
onUpdate in interface Persistentpublic void onDelete()
PersistentStore.delete(Class, String, Object[]) and
Store.delete(String, String, Object[]) methods do NOT call Persistent.onDelete().
onDelete in interface Persistentpublic void onRead()
Persistent
onRead in interface Persistentpublic boolean equals(Object o)
true if they
are equal (i.e., they must have the same OID and the same class).
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic Object getValue()
String representation) of this
KeyValuePair.
getValue in interface KeyValuePair<Object,Object>public Object getKey()
KeyValuePair.
getKey in interface KeyValuePair<Object,Object>public Object clone()
clone in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||