Package de.xima.fc.dao.utils
Class CriteriaApiHelper.SelectCtx<QT>
- java.lang.Object
-
- de.xima.fc.dao.utils.CriteriaApiHelper.SelectCtx<QT>
-
- Type Parameters:
QT- the query type.
- Enclosing class:
- CriteriaApiHelper
public static final class CriteriaApiHelper.SelectCtx<QT> extends Object
Wraps theEntityManagerprovided by the entity context, aCriteriaBuilderand aCriteriaQuery. This can replace the well-known three-liner
byEntityManager em = ec.getEm(); CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery<XyzEntity> cq = cb.createQuery(XyzEntity.class);SelectCtx<XyzEntity> ctx = CriteriaApiHelper.selectCtx(ec);
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.persistence.TypedQuery<QT>createQuery()Creates aTypedQueryinstance for executing a criteria query, does the same asctx.em.createQuery(ctx.cq).
-
-
-
Field Detail
-
cq
public final javax.persistence.criteria.CriteriaQuery<QT> cq
TheCriteriaQueryinstance.
-
-
Method Detail
-
createQuery
public javax.persistence.TypedQuery<QT> createQuery()
Creates aTypedQueryinstance for executing a criteria query, does the same asctx.em.createQuery(ctx.cq).- Returns:
- the resulting
TypedQuery
-
-