Package org.cxbox.model.core.dao.impl
Class JpaDaoImpl
java.lang.Object
org.cxbox.model.core.dao.impl.JpaDaoImpl
- All Implemented Interfaces:
JpaDao
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJpaDaoImpl(Set<jakarta.persistence.EntityManager> entityManagers, TransactionService txService) -
Method Summary
Modifier and TypeMethodDescription<T> voidapplyGraph(jakarta.persistence.criteria.Root<T> root, jakarta.persistence.EntityGraph<? super T> fetchGraph) <T> voidapplyGraph(Class<T> clazz, jakarta.persistence.criteria.Root<T> root, String fetchGraph) protected <T> jakarta.persistence.TypedQuery<T>applyPaging(jakarta.persistence.TypedQuery<T> query, PageSpecification page) protected <T> Stream<T>asStream(jakarta.persistence.TypedQuery<T> query) voidclear()<T extends BaseEntity>
T<T> intvoidvoid<T extends BaseEntity>
Tevict(T o) <T> boolean<T extends BaseEntity>
TfetchBySpecification(Class<T> entityClass, org.springframework.data.jpa.domain.Specification<T> specification) <T extends BaseEntity>
T<T extends BaseEntity>
Tvoidflush()<T> Long<T> jakarta.persistence.EntityGraph<? super T>getEntityGraph(Class<T> clazz, String name) <T> jakarta.persistence.metamodel.EntityType<T>getEntityType(Class<T> cls) protected jakarta.persistence.metamodel.EntityType<BaseEntity>getEntityType(String name) <R,T> T getFirstResultOrNull(Class<R> rootClass, Class<T> targetClass, Selector<R, T> selector, org.springframework.data.jpa.domain.Specification<R> specification) <T> TgetFirstResultOrNull(Class<T> entityClass, org.springframework.data.jpa.domain.Specification<T> specification) protected jakarta.persistence.criteria.JoinTypegetJoinType(jakarta.persistence.criteria.FetchParent fetch, String attrName) protected jakarta.persistence.criteria.JoinTypegetJoinType(jakarta.persistence.criteria.From from, String attrName) <R,T> List<T> getList(Class<R> rootClass, Class<T> targetClass, Selector<R, T> selector, org.springframework.data.jpa.domain.Specification<R> specification) <T> List<T><T,X> List<T> <T> List<T><T> List<T>getListByIds(Class<T> clazz, List<Long> ids) <R,T> ResultPage<T> getPage(Class<R> rootClass, Class<T> targetClass, Selector<R, T> selector, org.springframework.data.jpa.domain.Specification<R> specification, PageSpecification page) <T> ResultPage<T>getPage(Class<T> entityClass, org.springframework.data.jpa.domain.Specification<T> specification, PageSpecification page) <R,T> T getSingleResult(Class<R> rootClass, Class<T> targetClass, Selector<R, T> selector, org.springframework.data.jpa.domain.Specification<R> specification) <T> TgetSingleResult(Class<T> entityClass, org.springframework.data.jpa.domain.Specification<T> specification) <R,T> T getSingleResultOrNull(Class<R> rootClass, Class<T> targetClass, Selector<R, T> selector, org.springframework.data.jpa.domain.Specification<R> specification) <T> TgetSingleResultOrNull(Class<T> entityClass, org.springframework.data.jpa.domain.Specification<T> specification) <R,T> Stream<T> getStream(Class<R> rootClass, Class<T> targetClass, Selector<R, T> selector, org.springframework.data.jpa.domain.Specification<R> specification) <T> Stream<T>protected jakarta.persistence.EntityManagergetSupportedEntityManager(String entityClazz) protected <R,T> jakarta.persistence.TypedQuery<T> getTypedQuery(Class<R> rootClass, Class<T> targetClass, Selector<R, T> selector, org.springframework.data.jpa.domain.Specification<R> specification) voidlock(AbstractEntity entity, jakarta.persistence.LockModeType lockMode, int timeout) voidlockAndRefresh(AbstractEntity entity, int timeout) voidvoidrevert(AbstractEntity entity) <T> T<T> List<T>void<T> List<T><T> intupdate(Class<T> entityClass, org.springframework.data.jpa.domain.Specification<T> spec, UpdateSpecification<T> updateSpec)
-
Field Details
-
txService
-
-
Constructor Details
-
JpaDaoImpl
public JpaDaoImpl(Set<jakarta.persistence.EntityManager> entityManagers, TransactionService txService)
-
-
Method Details
-
getSupportedEntityManager
-
findById
-
findById
-
getEntityGraph
- Specified by:
getEntityGraphin interfaceJpaDao
-
applyGraph
public <T> void applyGraph(Class<T> clazz, jakarta.persistence.criteria.Root<T> root, String fetchGraph) - Specified by:
applyGraphin interfaceJpaDao
-
getList
-
applyGraph
public <T> void applyGraph(jakarta.persistence.criteria.Root<T> root, jakarta.persistence.EntityGraph<? super T> fetchGraph) - Specified by:
applyGraphin interfaceJpaDao
-
getJoinType
protected jakarta.persistence.criteria.JoinType getJoinType(jakarta.persistence.criteria.FetchParent fetch, String attrName) -
getJoinType
protected jakarta.persistence.criteria.JoinType getJoinType(jakarta.persistence.criteria.From from, String attrName) -
getListByIds
- Specified by:
getListByIdsin interfaceJpaDao
-
getCount
-
getCount
-
flush
public void flush() -
clear
public void clear() -
refresh
-
save
-
saveAll
-
evict
-
delete
-
delete
-
getList
-
delete
public <T> int delete(Class<T> entityClass, org.springframework.data.jpa.domain.Specification<T> spec) -
update
public <T> int update(Class<T> entityClass, org.springframework.data.jpa.domain.Specification<T> spec, UpdateSpecification<T> updateSpec) -
saveWithCompositeKey
- Specified by:
saveWithCompositeKeyin interfaceJpaDao
-
deleteWithCompositeKey
- Specified by:
deleteWithCompositeKeyin interfaceJpaDao
-
getIds
-
lock
-
lockAndRefresh
- Specified by:
lockAndRefreshin interfaceJpaDao
-
revert
-
selectNativeQuery
- Specified by:
selectNativeQueryin interfaceJpaDao
-
getList
-
getList
-
getPage
public <T> ResultPage<T> getPage(Class<T> entityClass, org.springframework.data.jpa.domain.Specification<T> specification, PageSpecification page) -
getStream
-
getSingleResult
public <T> T getSingleResult(Class<T> entityClass, org.springframework.data.jpa.domain.Specification<T> specification) - Specified by:
getSingleResultin interfaceJpaDao
-
fetchBySpecification
public <T extends BaseEntity> T fetchBySpecification(Class<T> entityClass, org.springframework.data.jpa.domain.Specification<T> specification) - Specified by:
fetchBySpecificationin interfaceJpaDao
-
getSingleResultOrNull
public <T> T getSingleResultOrNull(Class<T> entityClass, org.springframework.data.jpa.domain.Specification<T> specification) - Specified by:
getSingleResultOrNullin interfaceJpaDao
-
getFirstResultOrNull
public <T> T getFirstResultOrNull(Class<T> entityClass, org.springframework.data.jpa.domain.Specification<T> specification) - Specified by:
getFirstResultOrNullin interfaceJpaDao
-
exists
public <T> boolean exists(Class<T> entityClass, org.springframework.data.jpa.domain.Specification<T> specification) -
applyPaging
protected <T> jakarta.persistence.TypedQuery<T> applyPaging(jakarta.persistence.TypedQuery<T> query, PageSpecification page) -
getPage
public <R,T> ResultPage<T> getPage(Class<R> rootClass, Class<T> targetClass, Selector<R, T> selector, org.springframework.data.jpa.domain.Specification<R> specification, PageSpecification page) -
getStream
-
getSingleResult
public <R,T> T getSingleResult(Class<R> rootClass, Class<T> targetClass, Selector<R, T> selector, org.springframework.data.jpa.domain.Specification<R> specification) - Specified by:
getSingleResultin interfaceJpaDao
-
getSingleResultOrNull
public <R,T> T getSingleResultOrNull(Class<R> rootClass, Class<T> targetClass, Selector<R, T> selector, org.springframework.data.jpa.domain.Specification<R> specification) - Specified by:
getSingleResultOrNullin interfaceJpaDao
-
getFirstResultOrNull
public <R,T> T getFirstResultOrNull(Class<R> rootClass, Class<T> targetClass, Selector<R, T> selector, org.springframework.data.jpa.domain.Specification<R> specification) - Specified by:
getFirstResultOrNullin interfaceJpaDao
-
getTypedQuery
-
asStream
-
getEntityType
-
getEntityType
- Specified by:
getEntityTypein interfaceJpaDao
-