Package com.tetsuwantech.atom.database
Class GenericDAO<E extends GenericEntity,K>
- java.lang.Object
-
- com.tetsuwantech.atom.database.GenericDAO<E,K>
-
- Direct Known Subclasses:
AuditDAO
,SubjectDAO
@Named("GenericDAO") public abstract class GenericDAO<E extends GenericEntity,K> extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.persistence.EntityManager
entityManager
protected Class<E>
type
-
Constructor Summary
Constructors Constructor Description GenericDAO()
GenericDAO(Class<E> type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Long
count(K where, String column)
E
find(Long id)
List<E>
findAll(K where, String column, String orderBy)
E
findFirst(K where, String column)
E
persistOrMerge(E object)
void
remove(E object)
List<E>
search(K where, String column, String text, String[] fields)
protected void
where(javax.persistence.criteria.CriteriaBuilder criteriaBuilder, javax.persistence.criteria.CriteriaQuery<?> criteriaQuery, javax.persistence.criteria.Root<E> rootQuery, K where, String column)
-
-
-
Field Detail
-
type
protected Class<E extends GenericEntity> type
-
entityManager
protected javax.persistence.EntityManager entityManager
-
-