public abstract class AbstractJpaStorage extends Object
| Constructor and Description |
|---|
AbstractJpaStorage()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected <T> void |
applySearchCriteriaToQuery(io.apiman.manager.api.beans.search.SearchCriteriaBean criteria,
javax.persistence.criteria.CriteriaBuilder builder,
javax.persistence.criteria.CriteriaQuery<?> query,
javax.persistence.criteria.Root<T> from,
boolean countOnly)
Applies the criteria found in the
SearchCriteriaBean to the JPA query. |
protected void |
beginTx() |
protected void |
commitTx() |
<T> void |
create(T bean) |
<T> void |
delete(T bean)
Delete using bean
|
protected <T> int |
executeCountQuery(io.apiman.manager.api.beans.search.SearchCriteriaBean criteria,
javax.persistence.EntityManager entityManager,
Class<T> type)
Gets a count of the number of rows that would be returned by the search.
|
protected <T> io.apiman.manager.api.beans.search.SearchResultsBean<T> |
find(io.apiman.manager.api.beans.search.SearchCriteriaBean criteria,
Class<T> type)
Get a list of entities based on the provided criteria and entity type.
|
<T> T |
get(Long id,
Class<T> type)
Get object of type T
|
<T> T |
get(String id,
Class<T> type)
Get object of type T
|
<T> T |
get(String organizationId,
String id,
Class<T> type)
Get object of type T
|
protected javax.persistence.EntityManager |
getActiveEntityManager() |
IEntityManagerFactoryAccessor |
getEmfAccessor() |
protected void |
rollbackTx() |
void |
setEmfAccessor(IEntityManagerFactoryAccessor emfAccessor) |
<T> void |
update(T bean) |
protected void beginTx()
throws io.apiman.manager.api.core.exceptions.StorageException
io.apiman.manager.api.core.exceptions.StorageExceptionIStorage.beginTx()protected void commitTx()
throws io.apiman.manager.api.core.exceptions.StorageException
io.apiman.manager.api.core.exceptions.StorageExceptionIStorage.commitTx()protected void rollbackTx()
IStorage.rollbackTx()protected javax.persistence.EntityManager getActiveEntityManager()
throws io.apiman.manager.api.core.exceptions.StorageException
io.apiman.manager.api.core.exceptions.StorageException - if a storage problem occurs while storing a beanpublic <T> void create(T bean)
throws io.apiman.manager.api.core.exceptions.StorageException
bean - the bean to createio.apiman.manager.api.core.exceptions.StorageException - if a storage problem occurs while storing a beanpublic <T> void update(T bean)
throws io.apiman.manager.api.core.exceptions.StorageException
bean - the bean to updateio.apiman.manager.api.core.exceptions.StorageException - if a storage problem occurs while storing a beanpublic <T> void delete(T bean)
throws io.apiman.manager.api.core.exceptions.StorageException
bean - the bean to deleteio.apiman.manager.api.core.exceptions.StorageException - if a storage problem occurs while storing a beanpublic <T> T get(Long id, Class<T> type) throws io.apiman.manager.api.core.exceptions.StorageException
id - identity keytype - class of type Tio.apiman.manager.api.core.exceptions.StorageException - if a storage problem occurs while storing a beanpublic <T> T get(String id, Class<T> type) throws io.apiman.manager.api.core.exceptions.StorageException
id - identity keytype - class of type Tio.apiman.manager.api.core.exceptions.StorageException - if a storage problem occurs while storing a beanpublic <T> T get(String organizationId, String id, Class<T> type) throws io.apiman.manager.api.core.exceptions.StorageException
organizationId - org idid - identitytype - class of type Tio.apiman.manager.api.core.exceptions.StorageException - if a storage problem occurs while storing a beanprotected <T> io.apiman.manager.api.beans.search.SearchResultsBean<T> find(io.apiman.manager.api.beans.search.SearchCriteriaBean criteria,
Class<T> type)
throws io.apiman.manager.api.core.exceptions.StorageException
criteria - type - io.apiman.manager.api.core.exceptions.StorageException - if a storage problem occurs while storing a beanprotected <T> int executeCountQuery(io.apiman.manager.api.beans.search.SearchCriteriaBean criteria,
javax.persistence.EntityManager entityManager,
Class<T> type)
criteria - entityManager - type - protected <T> void applySearchCriteriaToQuery(io.apiman.manager.api.beans.search.SearchCriteriaBean criteria,
javax.persistence.criteria.CriteriaBuilder builder,
javax.persistence.criteria.CriteriaQuery<?> query,
javax.persistence.criteria.Root<T> from,
boolean countOnly)
SearchCriteriaBean to the JPA query.criteria - builder - query - from - public IEntityManagerFactoryAccessor getEmfAccessor()
public void setEmfAccessor(IEntityManagerFactoryAccessor emfAccessor)
emfAccessor - the emfAccessor to setCopyright © 2015 JBoss, a division of Red Hat. All rights reserved.