public interface EntityManagerLite
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear the persistence context, causing all managed entities to become detached.
|
void |
close()
DO NOT CALL close() as the container will do this automatically.
|
boolean |
contains(Object entity)
Check if the instance is a managed entity instance belonging to the current persistence context.
|
javax.persistence.Query |
createNamedQuery(String name)
Create an instance of Query for executing a named query (in the Java PersistenceUnitAdmin query language or in native SQL).
|
<T> T |
find(Class<T> entityClass,
Object primaryKey)
Find by primary key.
|
void |
flush()
Synchronize the persistence context to the underlying database.
|
Object |
getDelegate()
Returns EntityManagerDelegate object which provides access to OrmLite DAOs.
|
javax.persistence.FlushModeType |
getFlushMode()
Get the flush mode that applies to all objects contained in the persistence context.
|
<T> T |
getReference(Class<T> entityClass,
Object primaryKey)
Get an instance, whose state may be lazily fetched.
|
javax.persistence.EntityTransaction |
getTransaction()
Returns the resource-level transaction object, if User Transactions selected, otherwise proxy object returned for which only setRollbackOnly() is active.
|
boolean |
isOpen()
Determine whether the entity manager is open.
|
void |
joinTransaction()
NOT SUPPORTED.
|
void |
lock(Object entity,
javax.persistence.LockModeType lockMode)
NOT SUPPORTED.
|
<T> T |
merge(T entity)
Merge the state of the given entity into the current persistence context.
|
void |
persist(Object entity)
Make an instance managed and persistent.
|
void |
refresh(Object entity)
Refresh the state of the instance from the database, overwriting changes made to the entity, if any.
|
void |
remove(Object entity)
Remove the entity instance.
|
void |
setFlushMode(javax.persistence.FlushModeType flushMode)
Set the flush mode that applies to all objects contained in the persistence context.
|
void clear()
IllegalStateException - if this EntityManager has been closed.void close()
IllegalStateException - if this EntityManager has been closed.boolean contains(Object entity)
entity - the entity instanceIllegalArgumentException - if not an entityIllegalStateException - if this EntityManager has been closed.javax.persistence.Query createNamedQuery(String name)
name - the name of a query defined in metadataIllegalArgumentException - if a query has not been defined with the given name or if the query string is found to be invalidvoid flush()
PersistenceException - if the flush failsIllegalStateException - if this EntityManager has been closed.Object getDelegate()
IllegalStateException - if this EntityManager has been closed.javax.persistence.FlushModeType getFlushMode()
IllegalStateException - if this EntityManager has been closed.<T> T getReference(Class<T> entityClass, Object primaryKey)
T - the object type of the entityentityClass - the class of the entityprimaryKey - the primary keyIllegalArgumentException - if the first argument does not denote an entity type or the second argument is not a valid type for that entity’s primary
key or is nullEntityNotFoundException - if the entity state cannot be accessedIllegalStateException - if this EntityManager has been closed.javax.persistence.EntityTransaction getTransaction()
boolean isOpen()
<T> T merge(T entity)
T - the object type of the entityentity - the entity instanceIllegalArgumentException - if instance is not an entity or is a removed entityIllegalStateException - if this EntityManager has been closed.void persist(Object entity)
entity - the entity instanceIllegalArgumentException - if the instance is not an entityIllegalStateException - if this EntityManager has been closed.void refresh(Object entity)
entity - the entity instanceIllegalArgumentException - if the instance is not an entity or the entity is not managedIllegalStateException - if this EntityManager has been closed.void remove(Object entity)
entity - the entity instanceIllegalArgumentException - if the instance is not an entity or is a detached entityIllegalStateException - if this EntityManager has been closed.void setFlushMode(javax.persistence.FlushModeType flushMode)
flushMode - the flush modeIllegalStateException - if this EntityManager has been closed.<T> T find(Class<T> entityClass, Object primaryKey)
T - the object type of the entityentityClass - the class of the entityprimaryKey - the primary keyIllegalArgumentException - if the first argument does not denote an entity type or the second argument is is not a valid type for that entity’s
primary key or is nullIllegalStateException - if this EntityManager has been closed.void joinTransaction()
UnsupportedOperationExceptionvoid lock(Object entity, javax.persistence.LockModeType lockMode)
entity - the entity instancelockMode - the lock modeUnsupportedOperationExceptionThis documentation is licensed by Andrew Bowley under the GPLv3 License.