Class GenericEntityServiceImpl
java.lang.Object
org.broadleafcommerce.common.service.GenericEntityServiceImpl
- All Implemented Interfaces:
GenericEntityService
@Service("blGenericEntityService")
public class GenericEntityServiceImpl
extends Object
implements GenericEntityService
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clear level 1 cachevoid
void
void
flush()
Flush changes to the persistence storeClass<?>
getCeilingImplClass
(String className) Return the ceiling implementation class for an entityjakarta.persistence.EntityManager
Return the entity managergetIdentifier
(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 anEntity
and whether or not it already has an id assignedvoid
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.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) readGenericEntity
(String className, Object id) Finds a generic entity by a classname and idvoid
Attempt to delete the entity<T> T
save
(T object) Saves a generic entityboolean
sessionContains
(Object object) Whether or not the current hibernate session (level 1) contains the object
-
Field Details
-
genericEntityDao
-
-
Constructor Details
-
GenericEntityServiceImpl
public GenericEntityServiceImpl()
-
-
Method Details
-
readGenericEntity
Description copied from interface:GenericEntityService
Finds a generic entity by a classname and id- Specified by:
readGenericEntity
in interfaceGenericEntityService
- Returns:
- the entity
-
readGenericEntity
- Specified by:
readGenericEntity
in interfaceGenericEntityService
-
save
public <T> T save(T object) Description copied from interface:GenericEntityService
Saves a generic entity- Specified by:
save
in interfaceGenericEntityService
- Returns:
- the persisted version of the entity
-
persist
Description copied from interface:GenericEntityService
Persist the new object- Specified by:
persist
in interfaceGenericEntityService
-
readCountGenericEntity
Description copied from interface:GenericEntityService
Finds how many of the given entity class are persisted- Specified by:
readCountGenericEntity
in interfaceGenericEntityService
- Returns:
- the count of the generic entity
-
readAllGenericEntity
Description copied from interface:GenericEntityService
Finds all generic entities for a given classname, with pagination options.- Specified by:
readAllGenericEntity
in interfaceGenericEntityService
- Returns:
- the entities
-
readAllGenericEntityId
- Specified by:
readAllGenericEntityId
in interfaceGenericEntityService
-
getIdentifier
Description copied from interface:GenericEntityService
Retrieve the identifier from the Hibernate entity (the entity must reside in the current session)- Specified by:
getIdentifier
in interfaceGenericEntityService
- Returns:
-
flush
public void flush()Description copied from interface:GenericEntityService
Flush changes to the persistence store- Specified by:
flush
in interfaceGenericEntityService
-
clearAutoFlushMode
public void clearAutoFlushMode()- Specified by:
clearAutoFlushMode
in interfaceGenericEntityService
-
enableAutoFlushMode
public void enableAutoFlushMode()- Specified by:
enableAutoFlushMode
in interfaceGenericEntityService
-
clear
public void clear()Description copied from interface:GenericEntityService
Clear level 1 cache- Specified by:
clear
in interfaceGenericEntityService
-
sessionContains
Description copied from interface:GenericEntityService
Whether or not the current hibernate session (level 1) contains the object- Specified by:
sessionContains
in interfaceGenericEntityService
- Returns:
-
getCeilingImplClass
Description copied from interface:GenericEntityService
Return the ceiling implementation class for an entity- Specified by:
getCeilingImplClass
in interfaceGenericEntityService
- Returns:
-
idAssigned
Description copied from interface:GenericEntityService
Whether or not this object is anEntity
and whether or not it already has an id assigned- Specified by:
idAssigned
in interfaceGenericEntityService
- Returns:
-
getEntityManager
public jakarta.persistence.EntityManager getEntityManager()Description copied from interface:GenericEntityService
Return the entity manager- Specified by:
getEntityManager
in interfaceGenericEntityService
- Returns:
-
remove
Description copied from interface:GenericEntityService
Attempt to delete the entity- Specified by:
remove
in interfaceGenericEntityService
-