T
- the generic typeI
- the generic typepublic abstract class AbstractGenericDAOImpl<T extends Serializable,I extends Serializable> extends Object implements com.hack23.cia.service.data.api.AbstractGenericDAO<T,I>
Modifier | Constructor and Description |
---|---|
protected |
AbstractGenericDAOImpl(Class<T> persistentClass)
Instantiates a new abstract generic dao impl.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addCacheHints(javax.persistence.TypedQuery<?> typedQuery,
String comment)
Adds the cache hints.
|
void |
delete(T entity) |
T |
findFirstByProperty(javax.persistence.metamodel.SingularAttribute<T,? extends Object> property,
Object value) |
List<T> |
findListByProperty(Object[] values,
javax.persistence.metamodel.SingularAttribute<T,? extends Object>... properties) |
List<T> |
findListByProperty(javax.persistence.metamodel.SingularAttribute<T,? extends Object> property,
Object value) |
List<T> |
getAll() |
List<T> |
getAllOrderBy(javax.persistence.metamodel.SingularAttribute<T,? extends Object> orderBy) |
javax.persistence.criteria.CriteriaBuilder |
getCriteriaBuilder()
Gets the criteria builder.
|
protected javax.persistence.EntityManager |
getEntityManager()
Gets the entity manager.
|
protected org.hibernate.search.jpa.FullTextEntityManager |
getFullTextEntityManager()
Gets the full text entity manager.
|
protected javax.persistence.metamodel.Metamodel |
getMetamodel()
Gets the metamodel.
|
List<T> |
getPage(int pageNr,
int resultPerPage) |
List<T> |
getPageOrderBy(int pageNr,
int resultPerPage,
javax.persistence.metamodel.SingularAttribute<T,? extends Object> orderBy) |
Class<T> |
getPersistentClass()
Gets the persistent class.
|
Long |
getSize() |
T |
load(I id) |
T |
merge(T entity) |
void |
persist(List<T> list) |
void |
persist(T entity) |
List<T> |
search(String searchExpression,
Integer maxResults,
String... fields) |
protected final void addCacheHints(javax.persistence.TypedQuery<?> typedQuery, String comment)
typedQuery
- the typed querycomment
- the commentpublic final void delete(T entity)
delete
in interface com.hack23.cia.service.data.api.AbstractGenericDAO<T extends Serializable,I extends Serializable>
public final T findFirstByProperty(javax.persistence.metamodel.SingularAttribute<T,? extends Object> property, Object value)
findFirstByProperty
in interface com.hack23.cia.service.data.api.AbstractGenericDAO<T extends Serializable,I extends Serializable>
public final List<T> findListByProperty(Object[] values, javax.persistence.metamodel.SingularAttribute<T,? extends Object>... properties)
findListByProperty
in interface com.hack23.cia.service.data.api.AbstractGenericDAO<T extends Serializable,I extends Serializable>
public final List<T> findListByProperty(javax.persistence.metamodel.SingularAttribute<T,? extends Object> property, Object value)
findListByProperty
in interface com.hack23.cia.service.data.api.AbstractGenericDAO<T extends Serializable,I extends Serializable>
public final List<T> getAll()
getAll
in interface com.hack23.cia.service.data.api.AbstractGenericDAO<T extends Serializable,I extends Serializable>
public final List<T> getAllOrderBy(javax.persistence.metamodel.SingularAttribute<T,? extends Object> orderBy)
getAllOrderBy
in interface com.hack23.cia.service.data.api.AbstractGenericDAO<T extends Serializable,I extends Serializable>
public final javax.persistence.criteria.CriteriaBuilder getCriteriaBuilder()
protected final javax.persistence.EntityManager getEntityManager()
protected final org.hibernate.search.jpa.FullTextEntityManager getFullTextEntityManager()
protected final javax.persistence.metamodel.Metamodel getMetamodel()
public final List<T> getPage(int pageNr, int resultPerPage)
getPage
in interface com.hack23.cia.service.data.api.AbstractGenericDAO<T extends Serializable,I extends Serializable>
public final List<T> getPageOrderBy(int pageNr, int resultPerPage, javax.persistence.metamodel.SingularAttribute<T,? extends Object> orderBy)
getPageOrderBy
in interface com.hack23.cia.service.data.api.AbstractGenericDAO<T extends Serializable,I extends Serializable>
public final Class<T> getPersistentClass()
public final Long getSize()
getSize
in interface com.hack23.cia.service.data.api.AbstractGenericDAO<T extends Serializable,I extends Serializable>
public final T load(I id)
load
in interface com.hack23.cia.service.data.api.AbstractGenericDAO<T extends Serializable,I extends Serializable>
public final T merge(T entity)
merge
in interface com.hack23.cia.service.data.api.AbstractGenericDAO<T extends Serializable,I extends Serializable>
public final void persist(List<T> list)
persist
in interface com.hack23.cia.service.data.api.AbstractGenericDAO<T extends Serializable,I extends Serializable>
public final void persist(T entity)
persist
in interface com.hack23.cia.service.data.api.AbstractGenericDAO<T extends Serializable,I extends Serializable>
public final List<T> search(String searchExpression, Integer maxResults, String... fields)
search
in interface com.hack23.cia.service.data.api.AbstractGenericDAO<T extends Serializable,I extends Serializable>
Copyright © 2010–2017 www.hack23.com. All rights reserved.