public abstract class TypedQueryFactory extends Object
Modifier and Type | Field and Description |
---|---|
protected Class<?> |
actualResultType |
protected com.google.common.collect.ImmutableBiMap<String,javax.persistence.Parameter<?>> |
parameters |
Constructor and Description |
---|
TypedQueryFactory(Class<?> actualResultType,
ErraiParameter<?>[] parameters) |
Modifier and Type | Method and Description |
---|---|
<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.
|
protected final Class<?> actualResultType
protected final com.google.common.collect.ImmutableBiMap<String,javax.persistence.Parameter<?>> parameters
public TypedQueryFactory(Class<?> actualResultType, ErraiParameter<?>[] parameters)
public <T> javax.persistence.TypedQuery<T> createIfCompatible(Class<T> resultType, ErraiEntityManager entityManager)
T
- The result type of the queries produced by this factoryresultType
- The expected result typeentityManager
- the EntityManager the query will be executed in. Must not be null.resultType
.IllegalArgumentException
- if the query's result type is not assignable to the given type.protected abstract <T> javax.persistence.TypedQuery<T> createQuery(ErraiEntityManager entityManager)
the
- EntityManager the query will be executed in. Must not be null.Copyright © 2013-2015 JBoss, a division of Red Hat. All Rights Reserved.