com.groiss.store
Interface Persistent

All Known Subinterfaces:
Agent, DMSDocForm, DMSFolder, DMSFolderForm, DMSForm, DMSLink, DMSNote, DMSObject, DMSWebLink, Exportable, Keyword, OrgClass, OrgTree, OrgUnit, Permission, PermissionList, PersistentVersion, Right, Role, TimerEntry, User, UserRole, View
All Known Implementing Classes:
BasicEvent, BatchJob, DirectoryServer, ExportablePersistentObject, Lock, Partner, PersistentObject, ProcessRelation

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

getOid

long getOid()
Getter method for the persistent object's OID.

Returns:
The OID of the persistent object.

setOid

void setOid(long oid)
Setter method for the persistent object's OID. Usually you will never need to set the OID of an object directly, because OIDs are assigned automatically.

Parameters:
oid - The new OID for the object.

getStore

Store getStore()
This method must return the Store object that is responsible for storing this persistent object.

Returns:
The Store of this persistent object.

setStore

void setStore(Store s)
With this method you can change the Store of this persistent object. Usually objects are stored in the system's database and you will never need to set the Store manually.

Parameters:
s - The new Store that will be set for this persistent object.

getTableName

java.lang.String getTableName()
This method must return the table name of the database table in which this persistent object is stored.

Returns:
The table name of the database table in which this persistent object is stored.

dbFields

java.util.List<java.lang.reflect.Field> dbFields()
This method must return the persistent fields of this persistent object.

Returns:
A List containing the persistent fields of this persistent object. The List must contain the fields as java.lang.reflect.Field objects.

onInsert

void onInsert()
This method is called before the persistent object is inserted in the store.


onUpdate

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).


onDelete

void onDelete()
This method is called before the persistent object is deleted. Note that the Store.delete(Class, String, Object[]) and Store.delete(String, String, Object[]) methods do NOT call onDelete().


onRead

void onRead()
This method is called after the persistent object has been read.


setFilled

void setFilled(boolean f)
This method can change the filled status of this persistent object. See isFilled() for more details.

Parameters:
f - The new value for the filled status.

isFilled

boolean isFilled()
With this method you check if this persistent object is filled with persistent data or not. If it is not filled, you can use the Store to fill it.

Returns:
true if the object is filled with values, or false if the object is empty (only OID is set).


@enterprise 8.0.22989 Copyright © 2001-2017 Groiss Informatics GmbH. All Rights Reserved.