|
Oracle® Data Integrator Java API Reference 11g Release 1 (11.1.1.3.0) E17060-01 |
||||||||
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 |
---|
void close()
java.lang.IllegalStateException
- if this IOdiEntityManager is already closedjava.util.Collection findAll(java.lang.Class pRequiredType)
pRequiredType
- the entity class
java.lang.IllegalArgumentException
- if the given class doesn't derive from IOdiEntity
java.lang.IllegalStateException
- if this IOdiEntityManager has been closed
org.springframework.dao.DataAccessException
- if a data access error occursIOdiEntity findById(java.lang.Class pRequiredType, java.io.Serializable pId)
pRequiredType
- the entity classpId
- the entity identifier
java.lang.IllegalArgumentException
- if the given class doesn't derive from IOdiEntity
java.lang.IllegalStateException
- if this IOdiEntityManager has been closed
org.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 closed
org.springframework.dao.InvalidDataAccessApiUsageException
- if the method is called outside an active transaction
org.springframework.dao.DataAccessException
- if the flush failedIFinder 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 for
java.lang.IllegalArgumentException
- if the given type is not assignable from IOdiEntity
class
java.lang.IllegalArgumentException
- if the given entity type is null
java.lang.IllegalArgumentException
- if no finder found for the given type
java.lang.IllegalStateException
- if this IOdiEntityManager has been closedvoid 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 criteria
java.lang.IllegalArgumentException
- if the given entity is null
java.lang.IllegalArgumentException
- if the given initialization criteria is null
java.lang.IllegalStateException
- if this IOdiEntityManager has been closed
org.springframework.dao.DataAccessException
- if a data access error occursboolean isOpen()
true
if this IOdiEntityManager is open, false
otherwiseIOdiEntity 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 merge
java.lang.IllegalArgumentException
- if the given entity is null
or cannot be merged
java.lang.IllegalStateException
- if this IOdiEntityManager has been closed
org.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 persist
java.lang.IllegalStateException
- if this IOdiEntityManager has been closed
java.lang.IllegalArgumentException
- if the given entity is null
org.springframework.dao.DataAccessException
- if a data access error occursvoid refresh(IOdiEntity pEntity)
pEntity
- the entity object to refresh
java.lang.IllegalArgumentException
- if the given entity is null
java.lang.IllegalStateException
- if this IOdiEntityManager has been closed
org.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 remove
java.lang.IllegalArgumentException
- if the given entity is null
or cannot be removed
java.lang.IllegalStateException
- if this IOdiEntityManager has been closed
org.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 removed
java.lang.IllegalArgumentException
- if the given collection is
null
or contains entity that cannot be removed
java.lang.IllegalStateException
- if this IOdiEntityManager has been closed
org.springframework.dao.DataAccessException
- if a data access error occursremove(IOdiEntity)
void 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.3.0) E17060-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |