|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Persistent
Objects implementing this interface can be stored with the persistence
mechanism of @enterprise. Usually you will not implement this interface
directly. It's better to extend the abstract class
PersistentObject
, which provides a default
implementation, and override some methods if necessary.
Persistent objects can be stored with the methods provided by
OrgData
or Store
(get
instances of them from the ServiceLocator
).
The difference between them is that OrgData
checks user rights, creates log entries if necessary, etc.
So, in most cases it is a good idea to use OrgData
methods.
Method Summary | |
---|---|
java.util.List<java.lang.reflect.Field> |
dbFields()
This method must return the persistent fields of this persistent object. |
long |
getOid()
Getter method for the persistent object's OID. |
Store |
getStore()
This method must return the Store object that is responsible for
storing this persistent object. |
java.lang.String |
getTableName()
This method must return the table name of the database table in which this persistent object is stored. |
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 s)
With this method you can change the Store of this persistent object. |
Method Detail |
---|
long getOid()
void setOid(long oid)
oid
- The new OID for the object.Store getStore()
Store
object that is responsible for
storing this persistent object.
Store
of this persistent object.void setStore(Store s)
Store
of this persistent object.
Usually objects are stored in the system's database and you will never need
to set the Store
manually.
s
- The new Store
that will be set for this persistent object.java.lang.String getTableName()
java.util.List<java.lang.reflect.Field> dbFields()
List
containing the persistent fields of this
persistent object. The List
must contain the fields
as java.lang.reflect.Field
objects.void onInsert()
void onUpdate()
void onDelete()
Store.delete(Class, String, Object[])
and
Store.delete(String, String, Object[])
methods do NOT call onDelete()
.
void onRead()
void setFilled(boolean f)
isFilled()
for more details.
f
- The new value for the filled status.boolean isFilled()
Store
to fill it.
true
if the object is filled with values, or
false
if the object is empty (only OID is set).
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |