oracle.odi.core.persistence
Interface IOdiEntityManager

public interface IOdiEntityManager

Interface used to interact with the persistence context of an instance of ODI.

An IOdiEntityManager instance is associated with an instance of ODI's persistence context. That persistence context is made of IOdiEntitys Irrespectively of the ODI repository that effectively contains the IOdiEntity instances (Master repository, Work development repository or Work runtime repository). The persistence context manage the entities and their life cycle. The IOdiEntityManager interface provides the methods to interact with the persistence context in order to make CRUD (Create, Read, Update, Delete) operations against IOdiEntity instances.

persist

Make the given entity instance managed and persistent. Calling that method will also cascade persistence to related entities according to the cascading policy defined for the given entity.

This is the convenient method to store a newly created entity. All newly created entities must be persisted, by calling persist(IOdiEntity) on entities themseleves, or on any parent root entity according cascading policy, in order to be inserted at commit time.

After invoking that method, all persisted entities have got there identifier set.

merge

Merge the states of the given entity into the current persistent context.

This is the convenient method to to re-attach a detached instance to the persistent context. Can also be used to update an entity that has been loaded from another transaction. Calling that method will also cascade merge related entities according to the cascading policy.

The returned entity must be used in place of the merged entity after this method was called.

Parameters:

pEntity - the updated entity to merge

Returns:

the updated persistent instance that the state was merged to

Throws:

java.lang.IllegalArgumentException - if the given entity is null or cannot be merged