|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.garret.perst.Persistent
Base class for all persistent capable objects
| Constructor Summary | |
Persistent()
|
|
Persistent(Storage storage)
|
|
| Method Summary | |
void |
assignOid(Storage storage,
int oid,
boolean raw)
Assign OID to the object. |
void |
deallocate()
Deallocate persistent object from the database |
boolean |
equals(java.lang.Object o)
|
int |
getOid()
Get object identifier (OID) |
Storage |
getStorage()
Get storage in which this object is stored |
int |
hashCode()
|
void |
invalidate()
Invalidate object. |
boolean |
isDeleted()
Check if object is deleted by Java GC from process memory |
boolean |
isModified()
Check if object was modified within current transaction |
boolean |
isPersistent()
Check if object is persistent |
boolean |
isRaw()
Check if object is stub and has to be loaded from the database |
void |
load()
Load object from the database (if needed) |
void |
loadAndModify()
Load object from the database (if needed) and mark it as modified |
void |
makePersistent(Storage storage)
Explicitely make object peristent. |
void |
modify()
Mark object as modified. |
void |
onLoad()
Method called by the database after loading of the object. |
void |
onStore()
Method called by the database before storing of the object. |
void |
readExternal(java.io.ObjectInput s)
|
boolean |
recursiveLoading()
Specified whether object should be automatically loaded when it is referenced by other loaded peristent object. |
void |
store()
Save object in the database |
void |
writeExternal(java.io.ObjectOutput s)
|
| Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Persistent()
public Persistent(Storage storage)
| Method Detail |
public void assignOid(Storage storage,
int oid,
boolean raw)
IPersistent
assignOid in interface IPersistentstorage - associated storageoid - object identifierpublic void deallocate()
IPersistent
deallocate in interface IPersistentpublic boolean equals(java.lang.Object o)
public final int getOid()
IPersistent
getOid in interface IPersistentpublic final Storage getStorage()
IPersistent
getStorage in interface IPersistentpublic int hashCode()
public void invalidate()
IPersistent
invalidate in interface IPersistentpublic final boolean isDeleted()
IPersistent
isDeleted in interface IPersistenttrue if object is deleted by GCpublic final boolean isModified()
IPersistent
isModified in interface IPersistenttrue if object is persistent and was modified within current transactionpublic final boolean isPersistent()
IPersistent
isPersistent in interface IPersistenttrue if object has assigned OIDpublic final boolean isRaw()
IPersistent
isRaw in interface IPersistenttrue if object has to be loaded from the databasepublic void load()
IPersistent
load in interface IPersistentpublic void loadAndModify()
IPersistent
loadAndModify in interface IPersistentpublic void makePersistent(Storage storage)
IPersistent
makePersistent in interface IPersistentstorage - storage in which object should be storedpublic void modify()
IPersistent
modify in interface IPersistentpublic void onLoad()
IPersistent
onLoad in interface IPersistentpublic void onStore()
IPersistent
onStore in interface IPersistent
public void readExternal(java.io.ObjectInput s)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizablejava.io.IOException
java.lang.ClassNotFoundExceptionpublic boolean recursiveLoading()
IPersistenttrue making all cluster of referenced objects loaded together.
To avoid main memory overflow you should stop recursive loading of all objects
from the database to main memory by redefining this method in some classes and returing
false in it. In this case object has to be loaded explicitely
using Persistent.load method.
recursiveLoading in interface IPersistenttrue if object is automatically loadedpublic void store()
IPersistent
store in interface IPersistent
public void writeExternal(java.io.ObjectOutput s)
throws java.io.IOException
writeExternal in interface java.io.Externalizablejava.io.IOException
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||