org.jboss.errai.jpa.client.local
Class TypedQueryFactory
java.lang.Object
org.jboss.errai.jpa.client.local.TypedQueryFactory
public abstract class TypedQueryFactory
- extends Object
Factory class for creating TypedQuery instances. Used internally by
EntityManager's createXXXQuery methods.
- Author:
- Jonathan Fuerth
Method Summary |
<T> javax.persistence.TypedQuery<T> |
|
createIfCompatible(Class<T> resultType,
ErraiEntityManager entityManager)
Creates an instance of the TypedQuery associated with this factory if its
result type is assignable to the given type. |
protected abstract
<T> javax.persistence.TypedQuery<T> |
|
createQuery(ErraiEntityManager entityManager)
Subclasses must implement this method by returning a new instance of
ErraiTypedQuery that implements the query logic for the JPA query handled
by this factory. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
actualResultType
protected final Class<?> actualResultType
parameters
protected final com.google.common.collect.ImmutableBiMap<String,javax.persistence.Parameter<?>> parameters
TypedQueryFactory
public TypedQueryFactory(Class<?> actualResultType,
ErraiParameter<?>[] parameters)
createIfCompatible
public <T> javax.persistence.TypedQuery<T> createIfCompatible(Class<T> resultType,
ErraiEntityManager entityManager)
- Creates an instance of the TypedQuery associated with this factory if its
result type is assignable to the given type.
- Type Parameters:
T
- The result type of the queries produced by this factory- Parameters:
resultType
- The expected result typeentityManager
- the EntityManager the query will be executed in. Must not be null.
- Returns:
- A new instance of TypedQuery, whose result type is assignable to
resultType
.
- Throws:
IllegalArgumentException
- if the query's result type is not assignable to the given type.
createQuery
protected abstract <T> javax.persistence.TypedQuery<T> createQuery(ErraiEntityManager entityManager)
- Subclasses must implement this method by returning a new instance of
ErraiTypedQuery that implements the query logic for the JPA query handled
by this factory.
- Parameters:
the
- EntityManager the query will be executed in. Must not be null.
- Returns:
- a new instance of ErraiTypedQuery.
Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.