| Modifier and Type | Field and Description |
|---|---|
protected TransactionService |
txService |
| Constructor and Description |
|---|
JpaDaoImpl(Set<javax.persistence.EntityManager> entityManagers,
TransactionService txService) |
| Modifier and Type | Method and Description |
|---|---|
<T> void |
applyGraph(Class<T> clazz,
javax.persistence.criteria.Root<T> root,
String fetchGraph) |
<T> void |
applyGraph(javax.persistence.criteria.Root<T> root,
javax.persistence.EntityGraph<? super T> fetchGraph) |
protected <T> javax.persistence.TypedQuery<T> |
applyPaging(javax.persistence.TypedQuery<T> query,
PageSpecification page) |
protected <T> Stream<T> |
asStream(javax.persistence.TypedQuery<T> query) |
void |
clear() |
void |
delete(AbstractEntity o) |
<T extends BaseEntity> |
delete(Class<T> clazz,
Long id) |
<T> int |
delete(Class<T> entityClass,
org.springframework.data.jpa.domain.Specification<T> spec) |
void |
deleteWithCompositeKey(EmbeddedKeyable o) |
<T extends BaseEntity> |
evict(T o) |
<T> boolean |
exists(Class<T> entityClass,
org.springframework.data.jpa.domain.Specification<T> specification) |
<T extends BaseEntity> |
fetchBySpecification(Class<T> entityClass,
org.springframework.data.jpa.domain.Specification<T> specification) |
<T extends BaseEntity> |
findById(Class<T> clazz,
Long id) |
<T extends BaseEntity> |
findById(String type,
Long id) |
void |
flush() |
Long |
getCount(Class<?> clazz) |
<T> Long |
getCount(Class<T> entityClass,
org.springframework.data.jpa.domain.Specification<T> specification) |
<T> javax.persistence.EntityGraph<? super T> |
getEntityGraph(Class<T> clazz,
String name) |
<T> javax.persistence.metamodel.EntityType<T> |
getEntityType(Class<T> cls) |
protected javax.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> T |
getFirstResultOrNull(Class<T> entityClass,
org.springframework.data.jpa.domain.Specification<T> specification) |
<T> List<Long> |
getIds(Class<T> entityClazz,
org.springframework.data.jpa.domain.Specification<T> searchSpec) |
protected javax.persistence.criteria.JoinType |
getJoinType(javax.persistence.criteria.FetchParent fetch,
String attrName) |
protected javax.persistence.criteria.JoinType |
getJoinType(javax.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> |
getList(Class<T> entityClass) |
<T,X> List<T> |
getList(Class<T> clazz,
javax.persistence.metamodel.SingularAttribute<T,X> name,
X value) |
<T> List<T> |
getList(Class<T> entityClass,
org.springframework.data.jpa.domain.Specification<T> specification) |
<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> T |
getSingleResult(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> T |
getSingleResultOrNull(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> |
getStream(Class<T> entityClass,
org.springframework.data.jpa.domain.Specification<T> specification) |
protected javax.persistence.EntityManager |
getSupportedEntityManager(String entityClazz) |
protected <R,T> javax.persistence.TypedQuery<T> |
getTypedQuery(Class<R> rootClass,
Class<T> targetClass,
Selector<R,T> selector,
org.springframework.data.jpa.domain.Specification<R> specification) |
void |
lock(AbstractEntity entity,
javax.persistence.LockModeType lockMode,
int timeout) |
void |
lockAndRefresh(AbstractEntity entity,
int timeout) |
void |
refresh(AbstractEntity o) |
void |
revert(AbstractEntity entity) |
<T> T |
save(Object entity) |
void |
saveWithCompositeKey(EmbeddedKeyable o) |
<T> List<T> |
selectNativeQuery(Class<T> entityClazz,
String sql,
Map<String,Object> params) |
<T> int |
update(Class<T> entityClass,
org.springframework.data.jpa.domain.Specification<T> spec,
UpdateSpecification<T> updateSpec) |
@Lazy protected final TransactionService txService
public JpaDaoImpl(Set<javax.persistence.EntityManager> entityManagers, TransactionService txService)
protected javax.persistence.EntityManager getSupportedEntityManager(String entityClazz)
public <T extends BaseEntity> T findById(String type, Long id)
public <T extends BaseEntity> T findById(Class<T> clazz, Long id)
public <T> javax.persistence.EntityGraph<? super T> getEntityGraph(Class<T> clazz, String name)
getEntityGraph in interface JpaDaopublic <T> void applyGraph(Class<T> clazz, javax.persistence.criteria.Root<T> root, String fetchGraph)
applyGraph in interface JpaDaopublic <T,X> List<T> getList(Class<T> clazz, javax.persistence.metamodel.SingularAttribute<T,X> name, X value)
public <T> void applyGraph(javax.persistence.criteria.Root<T> root,
javax.persistence.EntityGraph<? super T> fetchGraph)
applyGraph in interface JpaDaoprotected javax.persistence.criteria.JoinType getJoinType(javax.persistence.criteria.FetchParent fetch,
String attrName)
protected javax.persistence.criteria.JoinType getJoinType(javax.persistence.criteria.From from,
String attrName)
public <T> List<T> getListByIds(Class<T> clazz, List<Long> ids)
getListByIds in interface JpaDaopublic <T> Long getCount(Class<T> entityClass, org.springframework.data.jpa.domain.Specification<T> specification)
public void refresh(AbstractEntity o)
public <T extends BaseEntity> T evict(T o)
public void delete(AbstractEntity o)
public <T extends BaseEntity> T delete(Class<T> clazz, Long id)
public <T> int delete(Class<T> entityClass, org.springframework.data.jpa.domain.Specification<T> spec)
public <T> int update(Class<T> entityClass, org.springframework.data.jpa.domain.Specification<T> spec, UpdateSpecification<T> updateSpec)
public void saveWithCompositeKey(EmbeddedKeyable o)
saveWithCompositeKey in interface JpaDaopublic void deleteWithCompositeKey(EmbeddedKeyable o)
deleteWithCompositeKey in interface JpaDaopublic <T> List<Long> getIds(Class<T> entityClazz, org.springframework.data.jpa.domain.Specification<T> searchSpec)
public void lock(AbstractEntity entity, javax.persistence.LockModeType lockMode, int timeout)
public void lockAndRefresh(AbstractEntity entity, int timeout)
lockAndRefresh in interface JpaDaopublic void revert(AbstractEntity entity)
public <T> List<T> selectNativeQuery(Class<T> entityClazz, String sql, Map<String,Object> params)
selectNativeQuery in interface JpaDaopublic <T> List<T> getList(Class<T> entityClass, org.springframework.data.jpa.domain.Specification<T> specification)
public <R,T> List<T> getList(Class<R> rootClass, Class<T> targetClass, Selector<R,T> selector, org.springframework.data.jpa.domain.Specification<R> specification)
public <T> ResultPage<T> getPage(Class<T> entityClass, org.springframework.data.jpa.domain.Specification<T> specification, PageSpecification page)
@Transactional(propagation=MANDATORY) public <T> Stream<T> getStream(Class<T> entityClass, org.springframework.data.jpa.domain.Specification<T> specification)
public <T> T getSingleResult(Class<T> entityClass, org.springframework.data.jpa.domain.Specification<T> specification)
getSingleResult in interface JpaDaopublic <T extends BaseEntity> T fetchBySpecification(Class<T> entityClass, org.springframework.data.jpa.domain.Specification<T> specification)
fetchBySpecification in interface JpaDaopublic <T> T getSingleResultOrNull(Class<T> entityClass, org.springframework.data.jpa.domain.Specification<T> specification)
getSingleResultOrNull in interface JpaDaopublic <T> T getFirstResultOrNull(Class<T> entityClass, org.springframework.data.jpa.domain.Specification<T> specification)
getFirstResultOrNull in interface JpaDaopublic <T> boolean exists(Class<T> entityClass, org.springframework.data.jpa.domain.Specification<T> specification)
protected <T> javax.persistence.TypedQuery<T> applyPaging(javax.persistence.TypedQuery<T> query,
PageSpecification page)
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)
@Transactional(propagation=MANDATORY) public <R,T> Stream<T> getStream(Class<R> rootClass, Class<T> targetClass, Selector<R,T> selector, org.springframework.data.jpa.domain.Specification<R> specification)
public <R,T> T getSingleResult(Class<R> rootClass, Class<T> targetClass, Selector<R,T> selector, org.springframework.data.jpa.domain.Specification<R> specification)
getSingleResult in interface JpaDaopublic <R,T> T getSingleResultOrNull(Class<R> rootClass, Class<T> targetClass, Selector<R,T> selector, org.springframework.data.jpa.domain.Specification<R> specification)
getSingleResultOrNull in interface JpaDaopublic <R,T> T getFirstResultOrNull(Class<R> rootClass, Class<T> targetClass, Selector<R,T> selector, org.springframework.data.jpa.domain.Specification<R> specification)
getFirstResultOrNull in interface JpaDaoprotected <R,T> javax.persistence.TypedQuery<T> getTypedQuery(Class<R> rootClass, Class<T> targetClass, Selector<R,T> selector, org.springframework.data.jpa.domain.Specification<R> specification)
protected <T> Stream<T> asStream(javax.persistence.TypedQuery<T> query)
protected javax.persistence.metamodel.EntityType<BaseEntity> getEntityType(String name)
public <T> javax.persistence.metamodel.EntityType<T> getEntityType(Class<T> cls)
getEntityType in interface JpaDaoCopyright © 2018–2021 Tesler. All rights reserved.