@Service(value="blGenericEntityService") public class GenericEntityServiceImpl extends Object implements GenericEntityService
Modifier and Type | Field and Description |
---|---|
protected GenericEntityDao |
genericEntityDao |
Constructor and Description |
---|
GenericEntityServiceImpl() |
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)
Return the ceiling implementation class for an entity
|
javax.persistence.EntityManager |
getEntityManager()
Return the entity manager
|
Serializable |
getIdentifier(Object entity)
Retrieve the identifier from the Hibernate entity (the entity must reside in the current session)
|
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 object
|
<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) |
Object |
readGenericEntity(String className,
Object id)
Finds a generic entity by a classname and id
|
void |
remove(Object object)
Attempt to delete 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
|
protected GenericEntityDao genericEntityDao
public Object readGenericEntity(String className, Object id)
GenericEntityService
readGenericEntity
in interface GenericEntityService
public <T> T readGenericEntity(Class<T> clazz, Object id)
readGenericEntity
in interface GenericEntityService
public <T> T save(T object)
GenericEntityService
save
in interface GenericEntityService
public void persist(Object object)
GenericEntityService
persist
in interface GenericEntityService
public <T> Long readCountGenericEntity(Class<T> clazz)
GenericEntityService
readCountGenericEntity
in interface GenericEntityService
public <T> List<T> readAllGenericEntity(Class<T> clazz, int limit, int offset)
GenericEntityService
readAllGenericEntity
in interface GenericEntityService
public List<Long> readAllGenericEntityId(Class<?> clazz)
readAllGenericEntityId
in interface GenericEntityService
public Serializable getIdentifier(Object entity)
GenericEntityService
getIdentifier
in interface GenericEntityService
public void flush()
GenericEntityService
flush
in interface GenericEntityService
public void clearAutoFlushMode()
clearAutoFlushMode
in interface GenericEntityService
public void enableAutoFlushMode()
enableAutoFlushMode
in interface GenericEntityService
public void clear()
GenericEntityService
clear
in interface GenericEntityService
public boolean sessionContains(Object object)
GenericEntityService
sessionContains
in interface GenericEntityService
public Class<?> getCeilingImplClass(String className)
GenericEntityService
getCeilingImplClass
in interface GenericEntityService
public boolean idAssigned(Object object)
GenericEntityService
Entity
and whether or not it already has an id assignedidAssigned
in interface GenericEntityService
public javax.persistence.EntityManager getEntityManager()
GenericEntityService
getEntityManager
in interface GenericEntityService
@Transactional(value="blTransactionManager") public void remove(Object object)
GenericEntityService
remove
in interface GenericEntityService
Copyright © 2022. All rights reserved.