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 TypeMethodDescriptionvoidclear()Clear level 1 cachevoidvoidvoidflush()Flush changes to the persistence storeClass<?>getCeilingImplClass(String className) Return the ceiling implementation class for an entityjakarta.persistence.EntityManagerReturn the entity managergetIdentifier(Object entity) Retrieve the identifier from the Hibernate entity (the entity must reside in the current session)booleanidAssigned(Object object) Whether or not this object is anEntityand whether or not it already has an id assignedvoidPersist 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> LongreadCountGenericEntity(Class<T> clazz) Finds how many of the given entity class are persisted<T> TreadGenericEntity(Class<T> clazz, Object id) readGenericEntity(String className, Object id) Finds a generic entity by a classname and idvoidAttempt to delete the entity<T> Tsave(T object) Saves a generic entitybooleansessionContains(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:GenericEntityServiceFinds a generic entity by a classname and id- Specified by:
readGenericEntityin interfaceGenericEntityService- Returns:
- the entity
-
readGenericEntity
- Specified by:
readGenericEntityin interfaceGenericEntityService
-
save
public <T> T save(T object) Description copied from interface:GenericEntityServiceSaves a generic entity- Specified by:
savein interfaceGenericEntityService- Returns:
- the persisted version of the entity
-
persist
Description copied from interface:GenericEntityServicePersist the new object- Specified by:
persistin interfaceGenericEntityService
-
readCountGenericEntity
Description copied from interface:GenericEntityServiceFinds how many of the given entity class are persisted- Specified by:
readCountGenericEntityin interfaceGenericEntityService- Returns:
- the count of the generic entity
-
readAllGenericEntity
Description copied from interface:GenericEntityServiceFinds all generic entities for a given classname, with pagination options.- Specified by:
readAllGenericEntityin interfaceGenericEntityService- Returns:
- the entities
-
readAllGenericEntityId
- Specified by:
readAllGenericEntityIdin interfaceGenericEntityService
-
getIdentifier
Description copied from interface:GenericEntityServiceRetrieve the identifier from the Hibernate entity (the entity must reside in the current session)- Specified by:
getIdentifierin interfaceGenericEntityService- Returns:
-
flush
public void flush()Description copied from interface:GenericEntityServiceFlush changes to the persistence store- Specified by:
flushin interfaceGenericEntityService
-
clearAutoFlushMode
public void clearAutoFlushMode()- Specified by:
clearAutoFlushModein interfaceGenericEntityService
-
enableAutoFlushMode
public void enableAutoFlushMode()- Specified by:
enableAutoFlushModein interfaceGenericEntityService
-
clear
public void clear()Description copied from interface:GenericEntityServiceClear level 1 cache- Specified by:
clearin interfaceGenericEntityService
-
sessionContains
Description copied from interface:GenericEntityServiceWhether or not the current hibernate session (level 1) contains the object- Specified by:
sessionContainsin interfaceGenericEntityService- Returns:
-
getCeilingImplClass
Description copied from interface:GenericEntityServiceReturn the ceiling implementation class for an entity- Specified by:
getCeilingImplClassin interfaceGenericEntityService- Returns:
-
idAssigned
Description copied from interface:GenericEntityServiceWhether or not this object is anEntityand whether or not it already has an id assigned- Specified by:
idAssignedin interfaceGenericEntityService- Returns:
-
getEntityManager
public jakarta.persistence.EntityManager getEntityManager()Description copied from interface:GenericEntityServiceReturn the entity manager- Specified by:
getEntityManagerin interfaceGenericEntityService- Returns:
-
remove
Description copied from interface:GenericEntityServiceAttempt to delete the entity- Specified by:
removein interfaceGenericEntityService
-