public class CriteriaQueryTypeQueryAdapter<X> extends Object implements TypedQuery<X>, HibernateQuery
Constructor and Description |
---|
CriteriaQueryTypeQueryAdapter(HibernateEntityManagerImplementor entityManager,
QueryImpl<X> jpqlQuery,
Map<ParameterExpression<?>,ExplicitParameterInfo<?>> explicitParameterInfoMap) |
Modifier and Type | Method and Description |
---|---|
int |
executeUpdate()
Execute an update or delete statement.
|
int |
getFirstResult()
The position of the first result the query object was set to
retrieve.
|
FlushModeType |
getFlushMode()
Get the flush mode in effect for the query execution.
|
Query |
getHibernateQuery()
Gives access to the underlying Hibernate query object..
|
Map<String,Object> |
getHints()
Get the properties and hints and associated values that are
in effect for the query instance.
|
LockModeType |
getLockMode()
Get the current lock mode for the query.
|
int |
getMaxResults()
The maximum number of results the query object was set to
retrieve.
|
Parameter<?> |
getParameter(int position)
Get the parameter object corresponding to the declared
positional parameter with the given position.
|
<T> Parameter<T> |
getParameter(int position,
Class<T> type)
Get the parameter object corresponding to the declared
positional parameter with the given position and type.
|
Parameter<?> |
getParameter(String name)
Get the parameter object corresponding to the declared
parameter of the given name.
|
<T> Parameter<T> |
getParameter(String name,
Class<T> type)
Get the parameter object corresponding to the declared
parameter of the given name and type.
|
Set<Parameter<?>> |
getParameters()
Get the parameter objects corresponding to the declared
parameters of the query.
|
Object |
getParameterValue(int position)
Return the value bound to the positional parameter.
|
<T> T |
getParameterValue(Parameter<T> param)
Return the value bound to the parameter.
|
Object |
getParameterValue(String name)
Return the value bound to the named parameter.
|
List<X> |
getResultList()
Execute a SELECT query and return the query results
as a typed List.
|
X |
getSingleResult()
Execute a SELECT query that returns a single result.
|
boolean |
isBound(Parameter<?> param)
Return a boolean indicating whether a value has been bound
to the parameter.
|
TypedQuery<X> |
setFirstResult(int i)
Set the position of the first result to retrieve.
|
TypedQuery<X> |
setFlushMode(FlushModeType flushModeType)
Set the flush mode type to be used for the query execution.
|
TypedQuery<X> |
setHint(String name,
Object value)
Set a query property or hint.
|
TypedQuery<X> |
setLockMode(LockModeType lockModeType)
Set the lock mode type to be used for the query execution.
|
TypedQuery<X> |
setMaxResults(int i)
Set the maximum number of results to retrieve.
|
TypedQuery<X> |
setParameter(int i,
Calendar calendar,
TemporalType temporalType)
Bind an instance of
java.util.Calendar to a positional
parameter. |
TypedQuery<X> |
setParameter(int i,
Date date,
TemporalType temporalType)
Bind an instance of
java.util.Date to a positional parameter. |
TypedQuery<X> |
setParameter(int i,
Object o)
Bind an argument to a positional parameter.
|
TypedQuery<X> |
setParameter(Parameter<Calendar> param,
Calendar calendar,
TemporalType temporalType)
Bind an instance of
java.util.Calendar to a Parameter object. |
TypedQuery<X> |
setParameter(Parameter<Date> param,
Date date,
TemporalType temporalType)
Bind an instance of
java.util.Date to a Parameter object. |
<T> TypedQuery<X> |
setParameter(Parameter<T> param,
T t)
Bind the value of a
Parameter object. |
TypedQuery<X> |
setParameter(String name,
Calendar calendar,
TemporalType temporalType)
Bind an instance of
java.util.Calendar to a named parameter. |
TypedQuery<X> |
setParameter(String name,
Date date,
TemporalType temporalType)
Bind an instance of
java.util.Date to a named parameter. |
TypedQuery<X> |
setParameter(String name,
Object value)
Bind an argument to a named parameter.
|
<T> T |
unwrap(Class<T> cls)
Return an object of the specified type to allow access to
the provider-specific API.
|
public CriteriaQueryTypeQueryAdapter(HibernateEntityManagerImplementor entityManager, QueryImpl<X> jpqlQuery, Map<ParameterExpression<?>,ExplicitParameterInfo<?>> explicitParameterInfoMap)
public Query getHibernateQuery()
HibernateQuery
getHibernateQuery
in interface HibernateQuery
public List<X> getResultList()
TypedQuery
getResultList
in interface Query
getResultList
in interface TypedQuery<X>
public X getSingleResult()
TypedQuery
getSingleResult
in interface Query
getSingleResult
in interface TypedQuery<X>
public int getMaxResults()
Query
Integer.MAX_VALUE
if setMaxResults
was not
applied to the query object.getMaxResults
in interface Query
public TypedQuery<X> setMaxResults(int i)
TypedQuery
setMaxResults
in interface Query
setMaxResults
in interface TypedQuery<X>
i
- maximum number of results to retrievepublic int getFirstResult()
Query
setFirstResult
was not applied to the
query object.getFirstResult
in interface Query
public TypedQuery<X> setFirstResult(int i)
TypedQuery
setFirstResult
in interface Query
setFirstResult
in interface TypedQuery<X>
i
- position of the first result,
numbered from 0public Map<String,Object> getHints()
Query
public TypedQuery<X> setHint(String name, Object value)
TypedQuery
setHint
in interface Query
setHint
in interface TypedQuery<X>
name
- name of property or hintvalue
- value for the property or hintpublic FlushModeType getFlushMode()
Query
getFlushMode
in interface Query
public TypedQuery<X> setFlushMode(FlushModeType flushModeType)
TypedQuery
setFlushMode
in interface Query
setFlushMode
in interface TypedQuery<X>
flushModeType
- flush modepublic LockModeType getLockMode()
Query
getLockMode
in interface Query
public TypedQuery<X> setLockMode(LockModeType lockModeType)
TypedQuery
setLockMode
in interface Query
setLockMode
in interface TypedQuery<X>
lockModeType
- lock modepublic Set<Parameter<?>> getParameters()
Query
getParameters
in interface Query
public boolean isBound(Parameter<?> param)
Query
public <T> T getParameterValue(Parameter<T> param)
Query
getParameterValue
in interface Query
param
- parameter objectpublic <T> TypedQuery<X> setParameter(Parameter<T> param, T t)
TypedQuery
Parameter
object.setParameter
in interface Query
setParameter
in interface TypedQuery<X>
param
- parameter objectt
- parameter valuepublic TypedQuery<X> setParameter(Parameter<Calendar> param, Calendar calendar, TemporalType temporalType)
TypedQuery
java.util.Calendar
to a Parameter
object.setParameter
in interface Query
setParameter
in interface TypedQuery<X>
param
- parameter objectcalendar
- parameter valuetemporalType
- temporal typepublic TypedQuery<X> setParameter(Parameter<Date> param, Date date, TemporalType temporalType)
TypedQuery
java.util.Date
to a Parameter
object.setParameter
in interface Query
setParameter
in interface TypedQuery<X>
param
- parameter objectdate
- parameter valuetemporalType
- temporal typepublic <T> T unwrap(Class<T> cls)
Query
PersistenceException
is thrown.public Object getParameterValue(String name)
Query
getParameterValue
in interface Query
name
- parameter namepublic Parameter<?> getParameter(String name)
Query
getParameter
in interface Query
name
- parameter namepublic <T> Parameter<T> getParameter(String name, Class<T> type)
Query
getParameter
in interface Query
name
- parameter nametype
- typepublic TypedQuery<X> setParameter(String name, Object value)
TypedQuery
setParameter
in interface Query
setParameter
in interface TypedQuery<X>
name
- parameter namevalue
- parameter valuepublic TypedQuery<X> setParameter(String name, Calendar calendar, TemporalType temporalType)
TypedQuery
java.util.Calendar
to a named parameter.setParameter
in interface Query
setParameter
in interface TypedQuery<X>
name
- parameter namecalendar
- parameter valuetemporalType
- temporal typepublic TypedQuery<X> setParameter(String name, Date date, TemporalType temporalType)
TypedQuery
java.util.Date
to a named parameter.setParameter
in interface Query
setParameter
in interface TypedQuery<X>
name
- parameter namedate
- parameter valuetemporalType
- temporal typepublic int executeUpdate()
Query
executeUpdate
in interface Query
public TypedQuery<X> setParameter(int i, Object o)
TypedQuery
setParameter
in interface Query
setParameter
in interface TypedQuery<X>
i
- positiono
- parameter valuepublic TypedQuery<X> setParameter(int i, Calendar calendar, TemporalType temporalType)
TypedQuery
java.util.Calendar
to a positional
parameter.setParameter
in interface Query
setParameter
in interface TypedQuery<X>
i
- positioncalendar
- parameter valuetemporalType
- temporal typepublic TypedQuery<X> setParameter(int i, Date date, TemporalType temporalType)
TypedQuery
java.util.Date
to a positional parameter.setParameter
in interface Query
setParameter
in interface TypedQuery<X>
i
- positiondate
- parameter valuetemporalType
- temporal typepublic Object getParameterValue(int position)
Query
getParameterValue
in interface Query
position
- positionpublic Parameter<?> getParameter(int position)
Query
getParameter
in interface Query
position
- positionpublic <T> Parameter<T> getParameter(int position, Class<T> type)
Query
getParameter
in interface Query
position
- positiontype
- typeCopyright © 2017 JBoss by Red Hat. All rights reserved.