org.dellroad.stuff.dao
Class TypedQueryCallback<T,R>

java.lang.Object
  extended by org.dellroad.stuff.dao.QueryCallback<R>
      extended by org.dellroad.stuff.dao.TypedQueryCallback<T,R>
Type Parameters:
T - persistent instance type
R - query return type
All Implemented Interfaces:
JpaCallback<R>
Direct Known Subclasses:
AbstractDAO.DAOQueryListCallback, AbstractDAO.DAOQueryUniqueCallback, CriteriaCallback

public abstract class TypedQueryCallback<T,R>
extends QueryCallback<R>

Helper class for building and executing JPA typed queries.


Constructor Summary
TypedQueryCallback()
           
 
Method Summary
protected abstract  TypedQuery<T> buildQuery(EntityManager entityManager)
          Build the typed query.
protected  R executeQuery(Query query)
          Delegates to executeQuery(TypedQuery).
protected abstract  R executeQuery(TypedQuery<T> query)
          Execute the query.
 
Methods inherited from class org.dellroad.stuff.dao.QueryCallback
doInJpa
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypedQueryCallback

public TypedQueryCallback()
Method Detail

executeQuery

protected final R executeQuery(Query query)
Delegates to executeQuery(TypedQuery).

Specified by:
executeQuery in class QueryCallback<R>

buildQuery

protected abstract TypedQuery<T> buildQuery(EntityManager entityManager)
Build the typed query.

Specified by:
buildQuery in class QueryCallback<R>

executeQuery

protected abstract R executeQuery(TypedQuery<T> query)
Execute the query.