public class CriteriaLogQuery<T> extends java.lang.Object implements TypedQuery<T>
Constructor and Description |
---|
CriteriaLogQuery(TypedQuery<T> query,
java.lang.String level) |
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.
|
java.util.Map<java.lang.String,java.lang.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,
java.lang.Class<T> type)
Get the parameter object corresponding to the declared
positional parameter with the given position and type.
|
Parameter<?> |
getParameter(java.lang.String name)
Get the parameter object corresponding to the declared
parameter of the given name.
|
<T> Parameter<T> |
getParameter(java.lang.String name,
java.lang.Class<T> type)
Get the parameter object corresponding to the declared
parameter of the given name and type.
|
java.util.Set<Parameter<?>> |
getParameters()
Get the parameter objects corresponding to the declared
parameters of the query.
|
java.lang.Object |
getParameterValue(int position)
Return the input value bound to the positional parameter.
|
<T> T |
getParameterValue(Parameter<T> param)
Return the input value bound to the parameter.
|
java.lang.Object |
getParameterValue(java.lang.String name)
Return the input value bound to the named parameter.
|
java.lang.String |
getQueryString() |
java.util.List<T> |
getResultList()
Execute a SELECT query and return the query results
as a typed List.
|
T |
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<T> |
setFirstResult(int startPosition)
Set the position of the first result to retrieve.
|
TypedQuery<T> |
setFlushMode(FlushModeType flushMode)
Set the flush mode type to be used for the query execution.
|
TypedQuery<T> |
setHint(java.lang.String hintName,
java.lang.Object value)
Set a query property or hint.
|
TypedQuery<T> |
setLockMode(LockModeType lockMode)
Set the lock mode type to be used for the query execution.
|
TypedQuery<T> |
setMaxResults(int maxResult)
Set the maximum number of results to retrieve.
|
TypedQuery<T> |
setParameter(int position,
java.util.Calendar value,
TemporalType temporalType)
Bind an instance of
java.util.Calendar to a positional
parameter. |
TypedQuery<T> |
setParameter(int position,
java.util.Date value,
TemporalType temporalType)
Bind an instance of
java.util.Date to a positional parameter. |
TypedQuery<T> |
setParameter(int position,
java.lang.Object value)
Bind an argument value to a positional parameter.
|
TypedQuery<T> |
setParameter(Parameter<java.util.Calendar> param,
java.util.Calendar value,
TemporalType temporalType)
Bind an instance of
java.util.Calendar to a Parameter object. |
TypedQuery<T> |
setParameter(Parameter<java.util.Date> param,
java.util.Date value,
TemporalType temporalType)
Bind an instance of
java.util.Date to a Parameter object. |
<E> TypedQuery<T> |
setParameter(Parameter<E> param,
E value)
Bind the value of a
Parameter object. |
TypedQuery<T> |
setParameter(java.lang.String name,
java.util.Calendar value,
TemporalType temporalType)
Bind an instance of
java.util.Calendar to a named parameter. |
TypedQuery<T> |
setParameter(java.lang.String name,
java.util.Date value,
TemporalType temporalType)
Bind an instance of
java.util.Date to a named parameter. |
TypedQuery<T> |
setParameter(java.lang.String name,
java.lang.Object value)
Bind an argument value to a named parameter.
|
<T> T |
unwrap(java.lang.Class<T> cls)
Return an object of the specified type to allow access to
the provider-specific API.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getResultStream
public CriteriaLogQuery(TypedQuery<T> query, java.lang.String level)
public java.lang.String getQueryString()
public java.util.List<T> getResultList()
TypedQuery
getResultList
in interface Query
getResultList
in interface TypedQuery<T>
public T getSingleResult()
TypedQuery
getSingleResult
in interface Query
getSingleResult
in interface TypedQuery<T>
public int executeUpdate()
Query
executeUpdate
in interface Query
public TypedQuery<T> setMaxResults(int maxResult)
TypedQuery
setMaxResults
in interface Query
setMaxResults
in interface TypedQuery<T>
maxResult
- maximum number of results to retrievepublic int getMaxResults()
Query
Integer.MAX_VALUE
if setMaxResults
was not
applied to the query object.getMaxResults
in interface Query
public TypedQuery<T> setFirstResult(int startPosition)
TypedQuery
setFirstResult
in interface Query
setFirstResult
in interface TypedQuery<T>
startPosition
- position of the first result,
numbered from 0public int getFirstResult()
Query
setFirstResult
was not applied to the
query object.getFirstResult
in interface Query
public TypedQuery<T> setHint(java.lang.String hintName, java.lang.Object value)
TypedQuery
setHint
in interface Query
setHint
in interface TypedQuery<T>
hintName
- name of property or hintvalue
- value for the property or hintpublic <E> TypedQuery<T> setParameter(Parameter<E> param, E value)
TypedQuery
Parameter
object.setParameter
in interface Query
setParameter
in interface TypedQuery<T>
param
- parameter objectvalue
- parameter valuepublic java.util.Map<java.lang.String,java.lang.Object> getHints()
Query
public TypedQuery<T> setParameter(Parameter<java.util.Calendar> param, java.util.Calendar value, TemporalType temporalType)
TypedQuery
java.util.Calendar
to a Parameter
object.setParameter
in interface Query
setParameter
in interface TypedQuery<T>
param
- parameter objectvalue
- parameter valuetemporalType
- temporal typepublic TypedQuery<T> setParameter(Parameter<java.util.Date> param, java.util.Date value, TemporalType temporalType)
TypedQuery
java.util.Date
to a Parameter
object.setParameter
in interface Query
setParameter
in interface TypedQuery<T>
param
- parameter objectvalue
- parameter valuetemporalType
- temporal typepublic TypedQuery<T> setParameter(java.lang.String name, java.lang.Object value)
TypedQuery
setParameter
in interface Query
setParameter
in interface TypedQuery<T>
name
- parameter namevalue
- parameter valuepublic TypedQuery<T> setParameter(java.lang.String name, java.util.Calendar value, TemporalType temporalType)
TypedQuery
java.util.Calendar
to a named parameter.setParameter
in interface Query
setParameter
in interface TypedQuery<T>
name
- parameter namevalue
- parameter valuetemporalType
- temporal typepublic TypedQuery<T> setParameter(java.lang.String name, java.util.Date value, TemporalType temporalType)
TypedQuery
java.util.Date
to a named parameter.setParameter
in interface Query
setParameter
in interface TypedQuery<T>
name
- parameter namevalue
- parameter valuetemporalType
- temporal typepublic TypedQuery<T> setParameter(int position, java.lang.Object value)
TypedQuery
setParameter
in interface Query
setParameter
in interface TypedQuery<T>
position
- positionvalue
- parameter valuepublic TypedQuery<T> setParameter(int position, java.util.Calendar value, TemporalType temporalType)
TypedQuery
java.util.Calendar
to a positional
parameter.setParameter
in interface Query
setParameter
in interface TypedQuery<T>
position
- positionvalue
- parameter valuetemporalType
- temporal typepublic TypedQuery<T> setParameter(int position, java.util.Date value, TemporalType temporalType)
TypedQuery
java.util.Date
to a positional parameter.setParameter
in interface Query
setParameter
in interface TypedQuery<T>
position
- positionvalue
- parameter valuetemporalType
- temporal typepublic java.util.Set<Parameter<?>> getParameters()
Query
getParameters
in interface Query
public Parameter<?> getParameter(java.lang.String name)
Query
getParameter
in interface Query
name
- parameter namepublic <T> Parameter<T> getParameter(java.lang.String name, java.lang.Class<T> type)
Query
getParameter
in interface Query
name
- parameter nametype
- typepublic Parameter<?> getParameter(int position)
Query
getParameter
in interface Query
position
- positionpublic <T> Parameter<T> getParameter(int position, java.lang.Class<T> type)
Query
getParameter
in interface Query
position
- positiontype
- typepublic boolean isBound(Parameter<?> param)
Query
public <T> T getParameterValue(Parameter<T> param)
Query
getParameterValue
in interface Query
param
- parameter objectpublic java.lang.Object getParameterValue(java.lang.String name)
Query
getParameterValue
in interface Query
name
- parameter namepublic java.lang.Object getParameterValue(int position)
Query
getParameterValue
in interface Query
position
- positionpublic TypedQuery<T> setFlushMode(FlushModeType flushMode)
TypedQuery
setFlushMode
in interface Query
setFlushMode
in interface TypedQuery<T>
flushMode
- flush modepublic FlushModeType getFlushMode()
Query
getFlushMode
in interface Query
public TypedQuery<T> setLockMode(LockModeType lockMode)
TypedQuery
setLockMode
in interface Query
setLockMode
in interface TypedQuery<T>
lockMode
- lock modepublic LockModeType getLockMode()
Query
getLockMode
in interface Query
public <T> T unwrap(java.lang.Class<T> cls)
Query
PersistenceException
is thrown.