@Repository(value="blGenericEntityDao") public class GenericEntityDaoImpl extends Object implements GenericEntityDao, org.springframework.context.ApplicationContextAware
Modifier and Type | Field and Description |
---|---|
protected DynamicDaoHelperImpl |
daoHelper |
protected javax.persistence.EntityManager |
em |
protected EntityConfiguration |
entityConfiguration |
protected PersistenceService |
persistenceService |
protected StreamingTransactionCapableUtil |
transactionUtil |
Constructor and Description |
---|
GenericEntityDaoImpl() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear level 1 cache
|
void |
clearAutoFlushMode() |
void |
enableAutoFlushMode() |
void |
flush()
Flush changes to the persistence store
|
Class<?> |
getCeilingImplClass(String className)
Finds the ceiling implementation for the entity
|
javax.persistence.EntityManager |
getEntityManager()
Gathers the
EntityManager that is based on blPU |
protected javax.persistence.EntityManager |
getEntityManager(Class clazz) |
static GenericEntityDaoImpl |
getGenericEntityDao() |
Serializable |
getIdentifier(Object entity)
Retrieve the identifier from the Hibernate entity (the entity must reside in the current session)
|
protected Field |
getIdField(Class<?> clazz) |
Class<?> |
getImplClass(String className)
For a given className, finds the parent implementation class as defined in the
EntityConfiguration |
boolean |
idAssigned(Object object)
Whether or not this object is an
Entity and whether or not it already has an id assigned |
void |
persist(Object object)
Persist the new entity
|
<T> List<T> |
readAllGenericEntity(Class<T> clazz) |
<T> List<T> |
readAllGenericEntity(Class<T> clazz,
int limit,
int offset)
Finds all generic entities for a given classname, with pagination options.
|
List<Long> |
readAllGenericEntityId(Class<?> clazz) |
<T> Long |
readCountGenericEntity(Class<T> clazz)
Finds how many of the given entity class are persisted
|
<T> T |
readGenericEntity(Class<T> clazz,
Object id)
Finds a generic entity by a classname and id
|
void |
remove(Object object)
Remove the entity
|
<T> T |
save(T object)
Saves a generic entity
|
boolean |
sessionContains(Object object)
Whether or not the current hibernate session (level 1) contains the object
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
protected javax.persistence.EntityManager em
protected PersistenceService persistenceService
protected EntityConfiguration entityConfiguration
protected StreamingTransactionCapableUtil transactionUtil
protected DynamicDaoHelperImpl daoHelper
public static GenericEntityDaoImpl getGenericEntityDao()
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public <T> T readGenericEntity(Class<T> clazz, Object id)
GenericEntityDao
readGenericEntity
in interface GenericEntityDao
public <T> Long readCountGenericEntity(Class<T> clazz)
GenericEntityDao
readCountGenericEntity
in interface GenericEntityDao
public <T> List<T> readAllGenericEntity(Class<T> clazz, int limit, int offset)
GenericEntityDao
readAllGenericEntity
in interface GenericEntityDao
public <T> List<T> readAllGenericEntity(Class<T> clazz)
readAllGenericEntity
in interface GenericEntityDao
public List<Long> readAllGenericEntityId(Class<?> clazz)
readAllGenericEntityId
in interface GenericEntityDao
public Class<?> getImplClass(String className)
GenericEntityDao
EntityConfiguration
getImplClass
in interface GenericEntityDao
public Class<?> getCeilingImplClass(String className)
GenericEntityDao
getCeilingImplClass
in interface GenericEntityDao
public Serializable getIdentifier(Object entity)
GenericEntityDao
getIdentifier
in interface GenericEntityDao
public <T> T save(T object)
GenericEntityDao
save
in interface GenericEntityDao
public void persist(Object object)
GenericEntityDao
persist
in interface GenericEntityDao
public void remove(Object object)
GenericEntityDao
remove
in interface GenericEntityDao
public void flush()
GenericEntityDao
flush
in interface GenericEntityDao
public void clearAutoFlushMode()
clearAutoFlushMode
in interface GenericEntityDao
public void enableAutoFlushMode()
enableAutoFlushMode
in interface GenericEntityDao
public void clear()
GenericEntityDao
clear
in interface GenericEntityDao
public boolean sessionContains(Object object)
GenericEntityDao
sessionContains
in interface GenericEntityDao
public boolean idAssigned(Object object)
GenericEntityDao
Entity
and whether or not it already has an id assignedidAssigned
in interface GenericEntityDao
public javax.persistence.EntityManager getEntityManager()
GenericEntityDao
EntityManager
that is based on blPUgetEntityManager
in interface GenericEntityDao
EntityManager
protected javax.persistence.EntityManager getEntityManager(Class clazz)
Copyright © 2022. All rights reserved.