| java.lang.Object org.objectweb.speedo.pm.lib.AbstractPOManager org.objectweb.speedo.pm.ejb.lib.EJBPOManager
EJBPOManager | public class EJBPOManager extends AbstractPOManager implements EJBPOManagerItf(Code) | | TODO: runtimeException thrown by the methods will cause the current
transaction to rollback
author: S.Chassande-Barrioz |
Method Summary | |
public void | clear() | public void | close() closes an application-managed EntityManager. | public boolean | contains(Object entity) | public Query | createNamedQuery(String name) Create an instance of Query for executing a named query (EJB QL or
native SQL). | public Query | createNativeQuery(String sqlString) Create an instance of Query for executing a native SQL statement. | public Query | createNativeQuery(String sqlString, Class resultClass) Create an instance of Query for executing a native SQL statement. | public Query | createNativeQuery(String sqlString, String resultSetMapping) Create an instance of Query for executing a native SQL statement. | public Query | createQuery(String ejbqlString) | public Object | find(Class entityClass, Object primaryKey) | public void | flush() Synchronize the persistence context to the underlying database. | public FlushModeType | getFlushMode() | public Object | getReference(Class entityClass, Object primaryKey) Get an instance, whoose state may be lazily fetched. | public EntityTransaction | getTransaction() Returns the resource-level transaction object. | public boolean | isOpen() Indicates whether the EntityManager is open. | public void | lock(Object arg0, LockModeType arg1) | public Object | merge(Object entity) | public void | persist(Object entity) | public void | refresh(Object entity) Refresh the state of the instanc from the database overwriting chages
mades to the entity, if any. | public void | remove(Object entity) | public void | setFlushMode(FlushModeType fmt) | public Object | speedoAttachCopy(Object detached, Map map) | public void | speedoDeletePersistent(Object o) | public void | speedoDeletePersistent(Object oid, Class pc) | public Object | speedoDetachCopy(PersistentObjectItf sp, Map map, Collection fgHints) | public FetchPlanItf | speedoGetFetchPlan() | public Object | speedoMakePersistent(PersistentObjectItf sp, Map map) | public void | speedoRefresh(PersistentObjectItf sp, Map map, Collection fgHints) | public void | speedoRetrieve(PersistentObjectItf sp, Map map, Collection fgHints) |
EJBPOManager | public EJBPOManager()(Code) | | |
clear | public void clear()(Code) | | |
close | public void close()(Code) | | closes an application-managed EntityManager. This method can only be
called when the EntityManaged is not associated with an active
transaction. After an EntityManager has been closed, all methodes on the
EntityManager instance will throw the IllegalStateException except for
isOpen, which will return false;
throws: java.lang.IllegalStateException - if the EntityManager isassociated with an active transaction or if the EntityManager is container-managed. See Also: javax.persistence.EntityManager.close |
contains | public boolean contains(Object entity)(Code) | | Check if the instance belongs to the current persistence context
Parameters: entity - throws: java.lang.IllegalArgumentException - if not an entity See Also: javax.persistence.EntityManager.contains(java.lang.Object) |
createNamedQuery | public Query createNamedQuery(String name)(Code) | | Create an instance of Query for executing a named query (EJB QL or
native SQL).
Parameters: name - the name of a query defined in metadata the new query instance throws: IllegalArgumentException - if query string is not valid See Also: javax.persistence.EntityManager.createNamedQuery(java.lang.String) |
createNativeQuery | public Query createNativeQuery(String sqlString)(Code) | | Create an instance of Query for executing a native SQL statement.
Parameters: sqlString - an EJB QL query string the new query instance throws: IllegalArgumentException - if query string is not valid See Also: javax.persistence.EntityManager.createNativeQuery(java.lang.String) |
createNativeQuery | public Query createNativeQuery(String sqlString, Class resultClass)(Code) | | Create an instance of Query for executing a native SQL statement.
Parameters: sqlString - an EJB QL query string Parameters: resultClass - the class of the resulting instances the new query instance throws: IllegalArgumentException - if query string is not valid See Also: javax.persistence.EntityManager.createNativeQuery(java.lang.Stringjava.lang.Class) |
createNativeQuery | public Query createNativeQuery(String sqlString, String resultSetMapping)(Code) | | Create an instance of Query for executing a native SQL statement.
Parameters: sqlString - an EJB QL query string Parameters: resultSetMapping - the class of the resulting instances the new query instance throws: IllegalArgumentException - if query string is not valid See Also: javax.persistence.EntityManager.createNativeQuery(java.lang.Stringjava.lang.String) |
createQuery | public Query createQuery(String ejbqlString)(Code) | | Create an instance of Query for executing an EJB QL statement
Parameters: ejbqlString - an EJB QL query string the new query instance throws: IllegalArgumentException - if query string is not valid See Also: javax.persistence.EntityManager.createQuery(java.lang.String) |
find | public Object find(Class entityClass, Object primaryKey)(Code) | | Find by primary key
Parameters: entityClass - Parameters: primaryKey - the found entity instance or null if the entity does not existthrows throws: java.lang.IllegalArgumentException - if the first argument does notdenote an entity type or the second argument is not a valid type for thatentity'primary key See Also: javax.persistence.EntityManager.find(java.lang.Classjava.lang.Object) |
flush | public void flush()(Code) | | Synchronize the persistence context to the underlying database.
throws: javax.persistence.TransactionRequiredException - if there is no transaction throws: javax.persistence.PersistenceException - if there the flush fails See Also: javax.persistence.EntityManager.flush |
getFlushMode | public FlushModeType getFlushMode()(Code) | | |
getReference | public Object getReference(Class entityClass, Object primaryKey)(Code) | | Get an instance, whoose state may be lazily fetched. If the requested
instance does not exist in the database, throws
javax.persistence.EntityNotFoundException when the instance state is
first accessed. (The container is permitted to throw
EntityNotFoundException when get is called.)
The application shoud not expect that the instance state will be
availlable upon detachment, unless it was accessed by the application
while the entity manager was open.
Parameters: entityClass - Parameters: primaryKey - the found entity instance throws: java.lang.IllegalArgumentException - if the first argument does notdenote an entity type or the second argument is not a valid type for thatentity'primary key throws: javax.persistence.EntityNotFoundException - if the entity state cannot be accessed See Also: javax.persistence.EntityManager.getReference(java.lang.Classjava.lang.Object) |
getTransaction | public EntityTransaction getTransaction()(Code) | | Returns the resource-level transaction object. The EntityTransaction
instance may be used serially to bein and commit multiple transactions.
EntityTransaction instance throws: java.lang.IllegalStateException - if invoked on a JTA EntityManageror an EntityManager that has been closed. See Also: javax.persistence.EntityManager.getTransaction |
isOpen | public boolean isOpen()(Code) | | Indicates whether the EntityManager is open.
true until the EntityManager has been closed. See Also: javax.persistence.EntityManager.isOpen |
merge | public Object merge(Object entity)(Code) | | Merge the state of the given entry into the current persistence context
Parameters: entity - the instance that the state was merge to throws: java.lang.IllegalArgumentException - if instance is not an entity or is a removed instance throws: javax.persistence.TransactionRequiredException - if there is no transaction See Also: javax.persistence.EntityManager.merge(java.lang.Object) |
persist | public void persist(Object entity)(Code) | | Make an instance managed and persistent
Parameters: entity - throws: java.lang.IllegalArgumentException - if not an entity or entity is detached throws: javax.persistence.TransactionRequiredException - if there is no transaction See Also: javax.persistence.EntityManager.persist(java.lang.Object) |
refresh | public void refresh(Object entity)(Code) | | Refresh the state of the instanc from the database overwriting chages
mades to the entity, if any.
Parameters: entity - throws: java.lang.IllegalArgumentException - if not an entity or entity is not managed. throws: javax.persistence.TransactionRequiredException - if there is no transaction throws: javax.persistence.EntityNotFoundException - if there is no longerexists in the database See Also: javax.persistence.EntityManager.refresh(java.lang.Object) |
remove | public void remove(Object entity)(Code) | | Remove the instance
Parameters: entity - throws: java.lang.IllegalArgumentException - if not an entity or if a detached entity throws: javax.persistence.TransactionRequiredException - if there is no transaction See Also: javax.persistence.EntityManager.remove(java.lang.Object) |
setFlushMode | public void setFlushMode(FlushModeType fmt)(Code) | | See Also: javax.persistence.EntityManager.setFlushMode(javax.persistence.FlushModeType) |
speedoDeletePersistent | public void speedoDeletePersistent(Object o)(Code) | | |
|
|