public class JPABusinessDataRepositoryImpl extends java.lang.Object implements BusinessDataRepository, ClassLoaderListener
| Constructor and Description |
|---|
JPABusinessDataRepositoryImpl(UserTransactionService transactionService,
BusinessDataModelRepository businessDataModelRepository,
TechnicalLoggerService loggerService,
java.util.Map<java.lang.String,java.lang.Object> configuration,
ClassLoaderService classLoaderService,
long tenantId) |
| Modifier and Type | Method and Description |
|---|---|
<T extends java.io.Serializable> |
find(java.lang.Class<T> resultClass,
java.lang.String jpqlQuery,
java.util.Map<java.lang.String,java.io.Serializable> parameters)
Finds an Entity that is defined in a deployed Business Data Model, through JPQL query.
|
protected <T extends java.io.Serializable> |
find(java.lang.Class<T> resultClass,
javax.persistence.TypedQuery<T> query,
java.util.Map<java.lang.String,java.io.Serializable> parameters) |
<T extends org.bonitasoft.engine.bdm.Entity> |
findById(java.lang.Class<T> entityClass,
java.lang.Long primaryKey)
Finds an Entity that is defined in a deployed Business Data Model.
|
<T extends org.bonitasoft.engine.bdm.Entity> |
findByIdentifiers(java.lang.Class<T> entityClass,
java.util.List<java.lang.Long> primaryKeys)
Finds (well-loaded) entities that is defined in a deployed Business Data Model.
|
<T extends org.bonitasoft.engine.bdm.Entity> |
findByIds(java.lang.Class<T> entityClass,
java.util.List<java.lang.Long> primaryKeys)
Finds entities that is defined in a deployed Business Data Model.
|
<T extends java.io.Serializable> |
findByNamedQuery(java.lang.String queryName,
java.lang.Class<T> resultClass,
java.util.Map<java.lang.String,java.io.Serializable> parameters) |
<T extends java.io.Serializable> |
findList(java.lang.Class<T> resultClass,
java.lang.String jpqlQuery,
java.util.Map<java.lang.String,java.io.Serializable> parameters,
int startIndex,
int maxResults) |
protected <T extends java.io.Serializable> |
findList(javax.persistence.TypedQuery<T> query,
java.util.Map<java.lang.String,java.io.Serializable> parameters,
int startIndex,
int maxResults) |
<T extends java.io.Serializable> |
findListByNamedQuery(java.lang.String queryName,
java.lang.Class<T> resultClass,
java.util.Map<java.lang.String,java.io.Serializable> parameters,
int startIndex,
int maxResults) |
java.util.Set<java.lang.String> |
getEntityClassNames()
Retrieves the
Set of known Entity class names in this Business Data Repository. |
protected javax.persistence.EntityManager |
getEntityManager() |
javax.persistence.EntityManagerFactory |
getEntityManagerFactory() |
org.bonitasoft.engine.bdm.Entity |
merge(org.bonitasoft.engine.bdm.Entity entity)
Reconnect the given entity with the persistence unit
|
void |
onDestroy(java.lang.ClassLoader oldClassLoader) |
void |
onUpdate(java.lang.ClassLoader newClassLoader) |
void |
pause()
Temporary halt the execution of this service.
|
void |
persist(org.bonitasoft.engine.bdm.Entity entity)
Saves or updates an entity in the Business Data Repository.
|
void |
remove(org.bonitasoft.engine.bdm.Entity entity)
Removes an entity from the Business Data Repository.
|
void |
resume()
resume the execution the service
|
void |
start()
Start the service
|
void |
stop() |
org.bonitasoft.engine.bdm.Entity |
unwrap(org.bonitasoft.engine.bdm.Entity wrapped)
Unwraps the Entity if necessary.
|
public JPABusinessDataRepositoryImpl(UserTransactionService transactionService, BusinessDataModelRepository businessDataModelRepository, TechnicalLoggerService loggerService, java.util.Map<java.lang.String,java.lang.Object> configuration, ClassLoaderService classLoaderService, long tenantId)
public void start()
LifecycleServicestart in interface LifecycleServicepublic void stop()
stop in interface LifecycleServicepublic javax.persistence.EntityManagerFactory getEntityManagerFactory()
public void pause()
LifecycleServicepause in interface LifecycleServicepublic void resume()
LifecycleServiceresume in interface LifecycleServicepublic java.util.Set<java.lang.String> getEntityClassNames()
BusinessDataRepositorySet of known Entity class names in this Business Data Repository.getEntityClassNames in interface BusinessDataRepositorySet of known Entity class names, as qualified class names.protected javax.persistence.EntityManager getEntityManager()
public <T extends org.bonitasoft.engine.bdm.Entity> T findById(java.lang.Class<T> entityClass,
java.lang.Long primaryKey)
throws SBusinessDataNotFoundException
BusinessDataRepositoryfindById in interface BusinessDataRepositoryentityClass - the class of the entity to search for.primaryKey - the primary key to search by.SBusinessDataNotFoundException - if the Business Data could not be found with the provided primary key.public <T extends org.bonitasoft.engine.bdm.Entity> java.util.List<T> findByIds(java.lang.Class<T> entityClass,
java.util.List<java.lang.Long> primaryKeys)
BusinessDataRepositoryfindByIds in interface BusinessDataRepositoryentityClass - the class of the entity to search for.primaryKeys - the primary keys.public <T extends org.bonitasoft.engine.bdm.Entity> java.util.List<T> findByIdentifiers(java.lang.Class<T> entityClass,
java.util.List<java.lang.Long> primaryKeys)
BusinessDataRepositoryfindByIdentifiers in interface BusinessDataRepositoryentityClass - the class of the entity to search for.primaryKeys - the primary keys.protected <T extends java.io.Serializable> T find(java.lang.Class<T> resultClass,
javax.persistence.TypedQuery<T> query,
java.util.Map<java.lang.String,java.io.Serializable> parameters)
throws NonUniqueResultException
NonUniqueResultExceptionpublic <T extends java.io.Serializable> T find(java.lang.Class<T> resultClass,
java.lang.String jpqlQuery,
java.util.Map<java.lang.String,java.io.Serializable> parameters)
throws NonUniqueResultException
BusinessDataRepositoryfind in interface BusinessDataRepositoryresultClass - the class of the entity to search for.jpqlQuery - the JPQL query string to search the entity.parameters - the parameters needed to execute the query.NonUniqueResultException - if more than one result was found.public <T extends java.io.Serializable> java.util.List<T> findList(java.lang.Class<T> resultClass,
java.lang.String jpqlQuery,
java.util.Map<java.lang.String,java.io.Serializable> parameters,
int startIndex,
int maxResults)
findList in interface BusinessDataRepositorypublic <T extends java.io.Serializable> T findByNamedQuery(java.lang.String queryName,
java.lang.Class<T> resultClass,
java.util.Map<java.lang.String,java.io.Serializable> parameters)
throws NonUniqueResultException
findByNamedQuery in interface BusinessDataRepositoryNonUniqueResultExceptionpublic <T extends java.io.Serializable> java.util.List<T> findListByNamedQuery(java.lang.String queryName,
java.lang.Class<T> resultClass,
java.util.Map<java.lang.String,java.io.Serializable> parameters,
int startIndex,
int maxResults)
findListByNamedQuery in interface BusinessDataRepositoryprotected <T extends java.io.Serializable> java.util.List<T> findList(javax.persistence.TypedQuery<T> query,
java.util.Map<java.lang.String,java.io.Serializable> parameters,
int startIndex,
int maxResults)
public void remove(org.bonitasoft.engine.bdm.Entity entity)
BusinessDataRepositoryremove in interface BusinessDataRepositoryentity - the entity to remove.public void persist(org.bonitasoft.engine.bdm.Entity entity)
BusinessDataRepositorypersist in interface BusinessDataRepositoryentity - the entity to save / update.public org.bonitasoft.engine.bdm.Entity merge(org.bonitasoft.engine.bdm.Entity entity)
BusinessDataRepositorymerge in interface BusinessDataRepositoryentity - the entity to reconnect.public org.bonitasoft.engine.bdm.Entity unwrap(org.bonitasoft.engine.bdm.Entity wrapped)
BusinessDataRepositoryunwrap in interface BusinessDataRepositorywrapped - the potential wrapped entitypublic void onUpdate(java.lang.ClassLoader newClassLoader)
onUpdate in interface ClassLoaderListenerpublic void onDestroy(java.lang.ClassLoader oldClassLoader)
onDestroy in interface ClassLoaderListener