Package com.flowlogix.jeedao
Class DaoHelper<TT,KT>
java.lang.Object
com.flowlogix.jeedao.DaoHelper<TT,KT>
- Type Parameters:
TT- Entity TypeKT- Primary Key Type
- All Implemented Interfaces:
Serializable
Lightweight wrapper around common JPA methods
This is the primary class in the
com.flowlogix.jeedao package
Main value-add is ability to easily add hints and query criteria to
findAll() and findRange(int, int) methods,
as well as count() methods
Another differentiator is that this class doesn't require inheritance,
although some use cases could inherit from InheritableDaoHelper class.
- Author:
- lprimak
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<RR> QueryCriteria<RR> buildQueryCriteria(Class<RR> cls) intcount()intcount(DaoHelper.Parameters<TT> parms) createNativeQuery(String sql, Class<?> resultClass) createNativeQuery(String sql, String resultMapping) findAll()findAll(DaoHelper.Parameters<TT> parms) find all with added criteria and hintsfindRange(int min, int max) findRange(int min, int max, DaoHelper.Parameters<TT> parms) find range with added criteria and hintsjavax.persistence.EntityManager
-
Constructor Details
-
DaoHelper
public DaoHelper()
-
-
Method Details
-
findAll
-
findAll
find all with added criteria and hints- Parameters:
parms-- Returns:
-
findRange
-
findRange
find range with added criteria and hints- Parameters:
min-max-parms-- Returns:
-
count
public int count() -
count
-
getEntityManager
public javax.persistence.EntityManager getEntityManager()- Returns:
- entity manager
-
buildQueryCriteria
-
buildQueryCriteria
-
createNativeQuery
-
createNativeQuery
-