|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
PersistableEntity interface replaces Entity. The difference to Entity is that this interface requires the Entity to hold the PersistedObject through the whole lifetime of Entity. Therefore, the PersistenceContainer instance must be assigned at creation of the Entity instance which is the responsibility of EntityFactory. Whenever a change is invoked on the Entity by calling corresponding TransactionManager methods, e.g TransactionManager.insert() or TransactionManager.modify(), method PersistableEntity.getPersistedObject() is called to obtain changed attributes / references. The lifetime of Entity may either end by normal finalization or by active deletion / replacement in the persistence. Active deletion means that TransactionManager.delete() is called for an Entity instance. Replacement means, that TransactionManager.modify() is called with an Entity instance that has an equal key but is not identical. In these cases of "actor" triggered end of lifetime, method transitionToTransient() is called to indicate to the Entity that it is removed from persistence.
Keep in mind that PersistableEntity should be implemented as wrapper around the PeristenceContainer. You should not store the values of attributes in variables inside your Entity. Just pass all values to the Container by caqlling the setAttribute() and setLink() methods.
EntityFactory
,
ClassDescriptor
,
PersistenceContainer
Method Summary | |
PersistenceContainer |
getPersistedObject()
Is called to get all attribute / links of the Entity instance. |
Method Detail |
public PersistenceContainer getPersistedObject()
The PersistenceContainer instance serves as a data container transporting data from the Entity instance to persistence.
PersistenceContainer
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |