Constructor and Description |
---|
EJBQueryImpl(DatabaseQuery query,
EntityManagerImpl entityManager)
Create an EJBQueryImpl with a DatabaseQuery.
|
EJBQueryImpl(String jpql,
EntityManagerImpl entityManager)
Build an EJBQueryImpl based on the given jpql string.
|
EJBQueryImpl(String queryDescription,
EntityManagerImpl entityManager,
boolean isNamedQuery)
Create an EJBQueryImpl with either a query name or an jpql string.
|
Modifier and Type | Method and Description |
---|---|
static DatabaseQuery |
buildEJBQLDatabaseQuery(String jpql,
AbstractSession session)
Build a DatabaseQuery from an jpql string.
|
static DatabaseQuery |
buildEJBQLDatabaseQuery(String queryName,
String jpqlQuery,
AbstractSession session,
Enum lockMode,
Map<String,Object> hints,
ClassLoader classLoader)
Build a DatabaseQuery from an JPQL string.
|
static DatabaseQuery |
buildSQLDatabaseQuery(Class resultClass,
String sqlString,
ClassLoader classLoader,
AbstractSession session)
Build a ReadAllQuery from a class and sql string.
|
static DatabaseQuery |
buildSQLDatabaseQuery(Class resultClass,
String sqlString,
Map<String,Object> hints,
ClassLoader classLoader,
AbstractSession session)
Build a ReadAllQuery for class and sql string.
|
static DatabaseQuery |
buildSQLDatabaseQuery(String sqlString,
ClassLoader classLoader,
AbstractSession session)
Build a DataReadQuery from a sql string.
|
static DatabaseQuery |
buildSQLDatabaseQuery(String sqlString,
Map<String,Object> hints,
ClassLoader classLoader,
AbstractSession session)
Build a DataReadQuery from a sql string.
|
static DatabaseQuery |
buildSQLDatabaseQuery(String sqlResultSetMappingName,
String sqlString,
ClassLoader classLoader,
AbstractSession session)
Build a ResultSetMappingQuery from a sql result set mapping name and sql
string.
|
static DatabaseQuery |
buildSQLDatabaseQuery(String sqlResultSetMappingName,
String sqlString,
Map<String,Object> hints,
ClassLoader classLoader,
AbstractSession session)
Build a ResultSetMappingQuery from a sql result set mapping name and sql
string.
|
Collection |
getResultCollection()
Non-standard method to return results of a ReadQuery that has a
containerPolicy that returns objects as a collection rather than a List
|
Cursor |
getResultCursor()
Non-standard method to return results of a ReadQuery that uses a Cursor.
|
X |
getSingleResult()
Execute a query that returns a single result.
|
EJBQueryImpl |
setFirstResult(int startPosition)
Set the position of the first result to retrieve.
|
EJBQueryImpl |
setFlushMode(javax.persistence.FlushModeType flushMode)
Set the flush mode type to be used for the query execution.
|
javax.persistence.TypedQuery<X> |
setHint(String hintName,
Object value)
Set an implementation-specific hint.
|
EJBQueryImpl |
setLockMode(javax.persistence.LockModeType lockMode)
Set the lock mode type to be used for the query execution.
|
EJBQueryImpl |
setMaxResults(int maxResult)
Set the maximum number of results to retrieve.
|
javax.persistence.TypedQuery |
setParameter(int position,
Calendar value,
javax.persistence.TemporalType temporalType)
Bind an instance of java.util.Calendar to a positional parameter.
|
javax.persistence.TypedQuery |
setParameter(int position,
Date value,
javax.persistence.TemporalType temporalType)
Bind an instance of java.util.Date to a positional parameter.
|
javax.persistence.TypedQuery |
setParameter(int position,
Object value)
Bind an argument to a positional parameter.
|
javax.persistence.TypedQuery |
setParameter(javax.persistence.Parameter<Calendar> param,
Calendar value,
javax.persistence.TemporalType temporalType)
Bind an instance of java.util.Calendar to a Parameter object.
|
javax.persistence.TypedQuery |
setParameter(javax.persistence.Parameter<Date> param,
Date value,
javax.persistence.TemporalType temporalType)
Bind an instance of java.util.Date to a Parameter object.
|
<T> javax.persistence.TypedQuery |
setParameter(javax.persistence.Parameter<T> param,
T value)
Set the value of a Parameter object.
|
javax.persistence.TypedQuery |
setParameter(String name,
Calendar value,
javax.persistence.TemporalType temporalType)
Bind an instance of java.util.Calendar to a named parameter.
|
javax.persistence.TypedQuery |
setParameter(String name,
Date value,
javax.persistence.TemporalType temporalType)
Bind an instance of java.util.Date to a named parameter.
|
javax.persistence.TypedQuery |
setParameter(String name,
Object value)
Bind an argument to a named parameter.
|
String |
toString() |
close, executeUpdate, getDatabaseQuery, getDatabaseQueryInternal, getEntityManager, getFirstResult, getFlushMode, getHints, getLockMode, getMaxResults, getMaxResultsInternal, getParameter, getParameter, getParameter, getParameter, getParameterId, getParameters, getParameterValue, getParameterValue, getParameterValue, getResultList, getSupportedHints, isBound, setDatabaseQuery, setMaxResultsInternal, unwrap
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getDatabaseQuery, getEntityManager, setDatabaseQuery
public EJBQueryImpl(DatabaseQuery query, EntityManagerImpl entityManager)
public EJBQueryImpl(String jpql, EntityManagerImpl entityManager)
public EJBQueryImpl(String queryDescription, EntityManagerImpl entityManager, boolean isNamedQuery)
isNamedQuery
- determines whether to treat the queryDescription as jpql or a
query name.public static DatabaseQuery buildEJBQLDatabaseQuery(String jpql, AbstractSession session)
jpql
- session
- the session to get the descriptors for this query for.public static DatabaseQuery buildEJBQLDatabaseQuery(String queryName, String jpqlQuery, AbstractSession session, Enum lockMode, Map<String,Object> hints, ClassLoader classLoader)
jpql
- the JPQL string.flushOnExecute
- flush the unit of work before executing the query.session
- the session to get the descriptors for this query for.hints
- a list of hints to be applied to the query.public static DatabaseQuery buildSQLDatabaseQuery(Class resultClass, String sqlString, ClassLoader classLoader, AbstractSession session)
public static DatabaseQuery buildSQLDatabaseQuery(Class resultClass, String sqlString, Map<String,Object> hints, ClassLoader classLoader, AbstractSession session)
hints
- a list of hints to be applied to the query.public static DatabaseQuery buildSQLDatabaseQuery(String sqlString, ClassLoader classLoader, AbstractSession session)
public static DatabaseQuery buildSQLDatabaseQuery(String sqlString, Map<String,Object> hints, ClassLoader classLoader, AbstractSession session)
public static DatabaseQuery buildSQLDatabaseQuery(String sqlResultSetMappingName, String sqlString, ClassLoader classLoader, AbstractSession session)
public static DatabaseQuery buildSQLDatabaseQuery(String sqlResultSetMappingName, String sqlString, Map<String,Object> hints, ClassLoader classLoader, AbstractSession session)
hints
- a list of hints to be applied to the query.public javax.persistence.TypedQuery<X> setHint(String hintName, Object value)
setHint
in interface javax.persistence.Query
setHint
in interface javax.persistence.TypedQuery<X>
hintName
- value
- IllegalArgumentException
- if the second argument is not valid for the implementationpublic EJBQueryImpl setLockMode(javax.persistence.LockModeType lockMode)
setLockMode
in interface javax.persistence.Query
setLockMode
in interface javax.persistence.TypedQuery<X>
setLockMode
in class QueryImpl
lockMode
- IllegalStateException
- if not a Java Persistence query language SELECT querypublic Collection getResultCollection()
getResultCollection
in interface JpaQuery<X>
public Cursor getResultCursor()
getResultCursor
in interface JpaQuery<X>
public X getSingleResult()
getSingleResult
in interface javax.persistence.Query
getSingleResult
in interface javax.persistence.TypedQuery<X>
getSingleResult
in class QueryImpl
javax.persistence.EntityNotFoundException
- if there is no resultjavax.persistence.NonUniqueResultException
- if more than one resultpublic EJBQueryImpl setFirstResult(int startPosition)
setFirstResult
in interface javax.persistence.Query
setFirstResult
in interface javax.persistence.TypedQuery<X>
setFirstResult
in class QueryImpl
start
- position of the first result, numbered from 0public EJBQueryImpl setFlushMode(javax.persistence.FlushModeType flushMode)
setFlushMode
in interface javax.persistence.Query
setFlushMode
in interface javax.persistence.TypedQuery<X>
setFlushMode
in class QueryImpl
flushMode
- public EJBQueryImpl setMaxResults(int maxResult)
setMaxResults
in interface javax.persistence.Query
setMaxResults
in interface javax.persistence.TypedQuery<X>
setMaxResults
in class QueryImpl
maxResult
- public javax.persistence.TypedQuery setParameter(int position, Calendar value, javax.persistence.TemporalType temporalType)
setParameter
in interface javax.persistence.Query
setParameter
in interface javax.persistence.TypedQuery<X>
position
- value
- temporalType
- public javax.persistence.TypedQuery setParameter(int position, Date value, javax.persistence.TemporalType temporalType)
setParameter
in interface javax.persistence.Query
setParameter
in interface javax.persistence.TypedQuery<X>
position
- value
- temporalType
- public javax.persistence.TypedQuery setParameter(int position, Object value)
setParameter
in interface javax.persistence.Query
setParameter
in interface javax.persistence.TypedQuery<X>
position
- value
- public javax.persistence.TypedQuery setParameter(javax.persistence.Parameter<Calendar> param, Calendar value, javax.persistence.TemporalType temporalType)
setParameter
in interface javax.persistence.Query
setParameter
in interface javax.persistence.TypedQuery<X>
parameter
- value
- temporalType
- IllegalArgumentException
- if position does not correspond to a parameter of the querypublic javax.persistence.TypedQuery setParameter(javax.persistence.Parameter<Date> param, Date value, javax.persistence.TemporalType temporalType)
setParameter
in interface javax.persistence.Query
setParameter
in interface javax.persistence.TypedQuery<X>
parameter
- objectvalue
- temporalType
- IllegalArgumentException
- if position does not correspond to a parameter of the querypublic <T> javax.persistence.TypedQuery setParameter(javax.persistence.Parameter<T> param, T value)
setParameter
in interface javax.persistence.Query
setParameter
in interface javax.persistence.TypedQuery<X>
param
- parameter to be setvalue
- parameter valueIllegalArgumentException
- if parameter does not correspond to a parameter of the querypublic javax.persistence.TypedQuery setParameter(String name, Calendar value, javax.persistence.TemporalType temporalType)
setParameter
in interface javax.persistence.Query
setParameter
in interface javax.persistence.TypedQuery<X>
name
- value
- temporalType
- public javax.persistence.TypedQuery setParameter(String name, Date value, javax.persistence.TemporalType temporalType)
setParameter
in interface javax.persistence.Query
setParameter
in interface javax.persistence.TypedQuery<X>
name
- value
- temporalType
- public javax.persistence.TypedQuery setParameter(String name, Object value)
setParameter
in interface javax.persistence.Query
setParameter
in interface javax.persistence.TypedQuery<X>
name
- the parameter namevalue
- EclipseLink 2.5.2, "build v20140319-9ad6abd" API Reference