com.sap.ip.me.api.persist.app
Interface PersistableEntity


public interface PersistableEntity

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.

Author:
SAP
See Also:
EntityFactory, ClassDescriptor, PersistenceContainer

Method Summary
 PersistenceContainer getPersistedObject()
          Is called to get all attribute / links of the Entity instance.
 

Method Detail

getPersistedObject

public PersistenceContainer getPersistedObject()
Is called to get all attribute / links of the Entity instance. This method is either called to provide the state of Entity to persistence for any kind of writing action.

The PersistenceContainer instance serves as a data container transporting data from the Entity instance to persistence.

Returns:
The persistedObject value
See Also:
PersistenceContainer


Copyright © 2005 SAP AG. All Rights Reserved.