public abstract class BaseJpaDao extends Object implements org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware
| Modifier and Type | Class and Description |
|---|---|
static class |
BaseJpaDao.NaturalIdQuery<T>
Build a query for an entity using its naturalId
|
| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
logger |
static String |
PERSISTENCE_UNIT_NAME |
| Constructor and Description |
|---|
BaseJpaDao() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
protected <T> javax.persistence.TypedQuery<T> |
createCachedQuery(javax.persistence.criteria.CriteriaQuery<T> criteriaQuery)
Common logic for creating and configuring JPA queries
|
protected <T> javax.persistence.criteria.CriteriaQuery<T> |
createCriteriaQuery(com.google.common.base.Function<javax.persistence.criteria.CriteriaBuilder,javax.persistence.criteria.CriteriaQuery<T>> builder) |
protected <T> BaseJpaDao.NaturalIdQuery<T> |
createNaturalIdQuery(Class<T> entityType)
Utility for creating queries based on naturalId.
|
protected <T> javax.persistence.criteria.ParameterExpression<T> |
createParameterExpression(Class<T> paramClass) |
protected <T> javax.persistence.criteria.ParameterExpression<T> |
createParameterExpression(Class<T> paramClass,
String name) |
protected <T> javax.persistence.TypedQuery<T> |
createQuery(javax.persistence.criteria.CriteriaQuery<T> criteriaQuery)
Common logic for creating and configuring JPA queries
|
org.springframework.context.ApplicationContext |
getApplicationContext() |
protected <T> String |
getCacheRegionName(javax.persistence.criteria.CriteriaQuery<T> criteriaQuery)
Creates the cache region name for the criteria query
|
protected javax.persistence.EntityManager |
getEntityManager() |
protected org.springframework.transaction.support.TransactionOperations |
getTransactionOperations() |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setEntityManager(javax.persistence.EntityManager entityManager) |
void |
setTransactionOperations(org.springframework.transaction.support.TransactionOperations transactionOperations) |
public static final String PERSISTENCE_UNIT_NAME
protected final org.slf4j.Logger logger
public final void setEntityManager(javax.persistence.EntityManager entityManager)
@Autowired public final void setTransactionOperations(org.springframework.transaction.support.TransactionOperations transactionOperations)
protected javax.persistence.EntityManager getEntityManager()
protected org.springframework.transaction.support.TransactionOperations getTransactionOperations()
public org.springframework.context.ApplicationContext getApplicationContext()
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
setApplicationContext in interface org.springframework.context.ApplicationContextAwarepublic void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanExceptionprotected final <T> javax.persistence.criteria.ParameterExpression<T> createParameterExpression(Class<T> paramClass)
protected final <T> javax.persistence.criteria.ParameterExpression<T> createParameterExpression(Class<T> paramClass, String name)
protected final <T> javax.persistence.criteria.CriteriaQuery<T> createCriteriaQuery(com.google.common.base.Function<javax.persistence.criteria.CriteriaBuilder,javax.persistence.criteria.CriteriaQuery<T>> builder)
protected final <T> javax.persistence.TypedQuery<T> createQuery(javax.persistence.criteria.CriteriaQuery<T> criteriaQuery)
criteriaQuery - The criteria to create the query fromprotected final <T> javax.persistence.TypedQuery<T> createCachedQuery(javax.persistence.criteria.CriteriaQuery<T> criteriaQuery)
criteriaQuery - The criteria to create the query fromprotected final <T> BaseJpaDao.NaturalIdQuery<T> createNaturalIdQuery(Class<T> entityType)
OpenEntityManager or
Transactional so that the Hibernate specific extensions are available.protected final <T> String getCacheRegionName(javax.persistence.criteria.CriteriaQuery<T> criteriaQuery)
criteriaQuery - The criteria to create the cache name forCopyright © 2016 Jasig. All Rights Reserved.