|
Oracle® Data Integrator Java API Reference 11g Release 1 (11.1.1.5.0) E17060-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 IOdiEntity
s 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.
IOdiEntity
have four fields IOdiEntity.getFirstDate()
, IOdiEntity.getFirstUser()
, IOdiEntity.getLastDate()
, IOdiEntity.getLastUser()
that are updated when inserting of updating the objects in the underlying database. These IOdiEntity
's fields will be refreshed after a flush() or at commit time, only if a persist() or a merge() has been called and some real changes have taken place in database.
Method Summary | |
---|---|
void |
close() Close this application-managed IOdiEntityManager. |
java.util.Collection |
findAll(java.lang.Class pRequiredType) Find all the entity instances of the given class from the ODI instance that manager belongs to. |
IOdiEntity |
findById(java.lang.Class pRequiredType, java.io.Serializable pId) Find the entity instance of the given class and with the given identifier / primary key from the ODI instance that manager belongs to. |
void |
flush() Synchronize the persistence context to the underlying repository database. |
IFinder |
getFinder(java.lang.Class pEntityType) Obtains the IFinder instance for the given entity type. |
void |
initialize(IOdiEntity pEntity, IInitializationCriteria pInitializationCriteria) WARNING : This method is experimental and may be removed in future drop. |
boolean |
isOpen() Returns whether this IOdiEntityManager is open, or not. |
IOdiEntity |
merge(IOdiEntity pEntity) Merge the states of the given entity into the current persistent context. |
void |
persist(IOdiEntity pEntity) Make the given entity instance managed and persistent. |
void |
refresh(IOdiEntity pEntity) Refresh the given entity with the persistente context. |
void |
remove(IOdiEntity pEntity) Remove the given entity from the persistent context. |
void |
removeAll(java.util.Collection pEntities) Remove all the given entities from the persistent context. |
void |
setDefaultContext(java.lang.String pContextCode) Sets the OdiContext with code equals to pContextCode as default. |
Method Detail |
---|
java.util.Collection findAll(java.lang.Class pRequiredType)
pRequiredType
- the entity classjava.lang.IllegalArgumentException
- if the given class doesn't derive from IOdiEntity
java.lang.IllegalStateException
- if this IOdiEntityManager has been closedorg.springframework.dao.DataAccessException
- if a data access error occursIOdiEntity findById(java.lang.Class pRequiredType, java.io.Serializable pId)
pRequiredType
- the entity classpId
- the entity identifierjava.lang.IllegalArgumentException
- if the given class doesn't derive from IOdiEntity
java.lang.IllegalStateException
- if this IOdiEntityManager has been closedorg.springframework.dao.DataAccessException
- if a data access error occursvoid persist(IOdiEntity pEntity)
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.
pEntity
- the entity to persistjava.lang.IllegalStateException
- if this IOdiEntityManager has been closedjava.lang.IllegalArgumentException
- if the given entity is nullorg.springframework.dao.DataAccessException
- if a data access error occursIOdiEntity merge(IOdiEntity pEntity)
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.
pEntity
- the updated entity to mergejava.lang.IllegalArgumentException
- if the given entity is null
or cannot be mergedjava.lang.IllegalStateException
- if this IOdiEntityManager has been closedorg.springframework.dao.DataAccessException
- if a data access error occursvoid remove(IOdiEntity pEntity)
This is the convenient method to delete an entity. Calling that method will also cascade remove related entities according to the cascading policy.
pEntity
- the entity to removejava.lang.IllegalArgumentException
- if the given entity is null
or cannot be removedjava.lang.IllegalStateException
- if this IOdiEntityManager has been closedorg.springframework.dao.DataAccessException
- if a data access error occursvoid removeAll(java.util.Collection pEntities)
Calling that method will also cascade remove to related entities according to the cascading policy.
pEntities
- the collection of entities to be removedjava.lang.IllegalArgumentException
- if the given collection is null
or contains entity that cannot be removedjava.lang.IllegalStateException
- if this IOdiEntityManager has been closedorg.springframework.dao.DataAccessException
- if a data access error occursremove(IOdiEntity)
IFinder getFinder(java.lang.Class pEntityType)
IFinder
instance for the given entity type.
The returned finder should be cast into the specific finder interface according the given entity type in order to access specific finder methods.
The finder interface is the convenient way to query entities for the 11g release.
pEntityType
- the entity type the finder has to provide support forjava.lang.IllegalArgumentException
- if the given type is not assignable from IOdiEntity
classjava.lang.IllegalArgumentException
- if the given entity type is nulljava.lang.IllegalArgumentException
- if no finder found for the given typejava.lang.IllegalStateException
- if this IOdiEntityManager has been closedvoid refresh(IOdiEntity pEntity)
pEntity
- the entity object to refreshjava.lang.IllegalArgumentException
- if the given entity is nulljava.lang.IllegalStateException
- if this IOdiEntityManager has been closedorg.springframework.dao.DataAccessException
- if a data access error occursvoid flush()
That method need to be called within an active transaction.
java.lang.IllegalStateException
- if this IOdiEntityManager has been closedorg.springframework.dao.InvalidDataAccessApiUsageException
- if the method is called outside an active transactionorg.springframework.dao.DataAccessException
- if the flush failedvoid initialize(IOdiEntity pEntity, IInitializationCriteria pInitializationCriteria)
Initialize pEntity using the specified IInitializationCriteria. Be aware that this method may be very eager depending on the specified pInitializationCriteria.
pEntity
- an entitypInitializationCriteria
- an init criteriajava.lang.IllegalArgumentException
- if the given entity is nulljava.lang.IllegalArgumentException
- if the given initialization criteria is nulljava.lang.IllegalStateException
- if this IOdiEntityManager has been closedorg.springframework.dao.DataAccessException
- if a data access error occursvoid close()
java.lang.IllegalStateException
- if this IOdiEntityManager is already closedboolean isOpen()
true
if this IOdiEntityManager is open, false
otherwisevoid setDefaultContext(java.lang.String pContextCode)
OdiContext
with code
equals to pContextCode
as default.pContextCode
- - the code
of existing OdiContext
which has to be set as default
|
Oracle® Data Integrator Java API Reference 11g Release 1 (11.1.1.5.0) E17060-02 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |