public class CriteriaQueryTypeQueryAdapter<X> extends Object implements QueryImplementor<X>
Constructor and Description |
---|
CriteriaQueryTypeQueryAdapter(SessionImplementor entityManager,
QueryImplementor<X> jpqlQuery,
Map<ParameterExpression<?>,ExplicitParameterInfo<?>> explicitParameterInfoMap) |
Modifier and Type | Method and Description |
---|---|
QueryImplementor |
addQueryHint(String hint)
Add a DB query hint to the SQL.
|
Type |
determineProperBooleanType(int position,
Object value,
Type defaultType) |
Type |
determineProperBooleanType(String name,
Object value,
Type defaultType) |
int |
executeUpdate()
Execute an update or delete statement.
|
CacheMode |
getCacheMode()
Obtain the CacheMode in effect for this query.
|
String |
getCacheRegion()
Obtain the name of the second level query cache region in which query results will be stored (if they are
cached, see the discussion on
Query.isCacheable() for more information). |
String |
getComment()
Obtain the comment currently associated with this query.
|
Integer |
getFetchSize()
Obtain the JDBC fetch size hint in effect for this query.
|
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.
|
FlushMode |
getHibernateFlushMode()
Obtain the FlushMode in effect for this query.
|
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.
|
LockOptions |
getLockOptions()
Obtains the LockOptions in effect for this query.
|
int |
getMaxResults()
The maximum number of results the query object was set to
retrieve.
|
String[] |
getNamedParameters()
Return the names of all named parameters of the query.
|
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.
|
ParameterMetadata |
getParameterMetadata()
Access to information about query parameters.
|
Set<Parameter<?>> |
getParameters()
Get the parameter objects corresponding to the declared
parameters of the query.
|
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.
|
Object |
getParameterValue(String name)
Return the input value bound to the named parameter.
|
QueryProducerImplementor |
getProducer()
Get the QueryProducer this Query originates from.
|
RowSelection |
getQueryOptions()
"QueryOptions" is a better name, I think, than "RowSelection" -> 6.0
|
String |
getQueryString()
Get the query string.
|
List<X> |
getResultList()
Execute a SELECT query and return the query results
as a typed List.
|
String[] |
getReturnAliases() |
Type[] |
getReturnTypes()
Return the Hibernate types of the query results.
|
X |
getSingleResult()
Execute a SELECT query that returns a single result.
|
Integer |
getTimeout()
Obtain the query timeout in seconds.
|
boolean |
isBound(Parameter<?> param)
Return a boolean indicating whether a value has been bound
to the parameter.
|
boolean |
isCacheable()
Are the results of this query eligible for second level query caching? This is different that second level
caching of any returned entities and collections.
|
protected boolean |
isNativeQuery() |
boolean |
isReadOnly()
Should entities and proxies loaded by this Query be put in read-only mode? If the
read-only/modifiable setting was not initialized, then the default
read-only/modifiable setting for the persistence context is returned instead.
|
Iterator<X> |
iterate()
Return the query results as an Iterator.
|
List<X> |
list()
Return the query results as a List.
|
ScrollableResults |
scroll()
Return the query results as ScrollableResults.
|
ScrollableResults |
scroll(ScrollMode scrollMode)
Return the query results as ScrollableResults.
|
QueryImplementor |
setCacheable(boolean cacheable)
Enable/disable second level query (result) caching for this query.
|
QueryImplementor<X> |
setCacheMode(CacheMode cacheMode)
(Re)set the current CacheMode in effect for this query.
|
QueryImplementor |
setCacheRegion(String cacheRegion)
Set the name of the cache region where query results should be cached (if cached at all).
|
QueryImplementor |
setComment(String comment)
Set the comment for this query.
|
QueryImplementor<X> |
setEntity(int position,
Object val)
Bind an instance of a mapped persistent class to a JDBC-style query parameter.
|
QueryImplementor<X> |
setEntity(String name,
Object val)
Bind an instance of a mapped persistent class to a named query parameter.
|
QueryImplementor |
setFetchSize(int fetchSize)
Sets a JDBC fetch size hint for the query.
|
QueryImplementor<X> |
setFirstResult(int i)
Set the position of the first result to retrieve.
|
QueryImplementor |
setFlushMode(FlushMode flushMode)
(Re)set the current FlushMode in effect for this query.
|
QueryImplementor<X> |
setFlushMode(FlushModeType flushModeType)
Set the flush mode type to be used for the query execution.
|
QueryImplementor<X> |
setHibernateFlushMode(FlushMode flushMode)
(Re)set the current FlushMode in effect for this query.
|
QueryImplementor<X> |
setHint(String name,
Object value)
Set a query property or hint.
|
QueryImplementor<X> |
setLockMode(LockModeType lockModeType)
Set the lock mode type to be used for the query execution.
|
QueryImplementor |
setLockMode(String alias,
LockMode lockMode)
Set the LockMode to use for specific alias (as defined in the query's FROM clause).
|
QueryImplementor |
setLockOptions(LockOptions lockOptions)
Set the lock options for the query.
|
QueryImplementor<X> |
setMaxResults(int maxResult)
Set the maximum number of results to retrieve.
|
void |
setOptionalEntityName(String entityName) |
void |
setOptionalId(Serializable id) |
void |
setOptionalObject(Object optionalObject) |
QueryImplementor<X> |
setParameter(int i,
Calendar calendar,
TemporalType temporalType)
Bind an instance of
java.util.Calendar to a positional
parameter. |
QueryImplementor<X> |
setParameter(int i,
Date date,
TemporalType temporalType)
Bind an instance of
java.util.Date to a positional parameter. |
QueryImplementor<X> |
setParameter(int position,
Instant value,
TemporalType temporalType) |
QueryImplementor<X> |
setParameter(int position,
LocalDateTime value,
TemporalType temporalType) |
QueryImplementor<X> |
setParameter(int i,
Object o)
Bind an argument value to a positional parameter.
|
QueryImplementor<X> |
setParameter(int position,
Object val,
Type type)
Bind a value to a JDBC-style query parameter.
|
QueryImplementor<X> |
setParameter(int position,
OffsetDateTime value,
TemporalType temporalType) |
<P> QueryImplementor<X> |
setParameter(int position,
P val,
TemporalType temporalType)
Bind a positional query parameter as some form of date/time using
the indicated temporal-type.
|
QueryImplementor<X> |
setParameter(int position,
ZonedDateTime value,
TemporalType temporalType) |
QueryImplementor<X> |
setParameter(Parameter<Calendar> param,
Calendar calendar,
TemporalType temporalType)
Bind an instance of
java.util.Calendar to a Parameter object. |
QueryImplementor<X> |
setParameter(Parameter<Date> param,
Date date,
TemporalType temporalType)
Bind an instance of
java.util.Date to a Parameter object. |
QueryImplementor<X> |
setParameter(Parameter<Instant> param,
Instant value,
TemporalType temporalType) |
QueryImplementor<X> |
setParameter(Parameter<LocalDateTime> param,
LocalDateTime value,
TemporalType temporalType) |
QueryImplementor<X> |
setParameter(Parameter<OffsetDateTime> param,
OffsetDateTime value,
TemporalType temporalType) |
<T> QueryImplementor<X> |
setParameter(Parameter<T> param,
T t)
Bind the value of a
Parameter object. |
QueryImplementor<X> |
setParameter(Parameter<ZonedDateTime> param,
ZonedDateTime value,
TemporalType temporalType) |
<P> QueryImplementor<X> |
setParameter(QueryParameter<P> parameter,
P val,
TemporalType temporalType)
Bind a query parameter as some form of date/time using the indicated
temporal-type.
|
<P> QueryImplementor<X> |
setParameter(QueryParameter<P> parameter,
P value,
Type type)
Bind a query parameter using the supplied Type
|
<T> QueryImplementor<X> |
setParameter(QueryParameter<T> parameter,
T val)
Bind a query parameter using its inferred Type.
|
QueryImplementor<X> |
setParameter(String name,
Calendar calendar,
TemporalType temporalType)
Bind an instance of
java.util.Calendar to a named parameter. |
QueryImplementor<X> |
setParameter(String name,
Date date,
TemporalType temporalType)
Bind an instance of
java.util.Date to a named parameter. |
QueryImplementor<X> |
setParameter(String name,
Instant value,
TemporalType temporalType) |
QueryImplementor<X> |
setParameter(String name,
LocalDateTime value,
TemporalType temporalType) |
QueryImplementor<X> |
setParameter(String name,
Object value)
Bind an argument value to a named parameter.
|
QueryImplementor<X> |
setParameter(String name,
Object val,
Type type)
Bind a named query parameter using the supplied Type
|
QueryImplementor<X> |
setParameter(String name,
OffsetDateTime value,
TemporalType temporalType) |
<P> QueryImplementor<X> |
setParameter(String name,
P val,
TemporalType temporalType)
Bind a named query parameter as some form of date/time using
the indicated temporal-type.
|
QueryImplementor<X> |
setParameter(String name,
ZonedDateTime value,
TemporalType temporalType) |
Query<X> |
setParameterList(int position,
Collection values) |
Query<X> |
setParameterList(int position,
Collection values,
Type type) |
Query<X> |
setParameterList(int position,
Object[] values) |
Query<X> |
setParameterList(int position,
Object[] values,
Type type) |
<P> QueryImplementor<X> |
setParameterList(QueryParameter<P> parameter,
Collection<P> values)
Bind multiple values to a query parameter using its inferred Type.
|
QueryImplementor<X> |
setParameterList(String name,
Collection values)
Bind multiple values to a named query parameter.
|
QueryImplementor<X> |
setParameterList(String name,
Collection values,
Type type)
Bind multiple values to a named query parameter.
|
QueryImplementor<X> |
setParameterList(String name,
Object[] values)
Bind multiple values to a named query parameter.
|
QueryImplementor<X> |
setParameterList(String name,
Object[] values,
Type type)
Bind multiple values to a named query parameter.
|
QueryImplementor |
setProperties(Map map)
Bind the values of the given Map for each named parameters of the query,
matching key names with parameter names and mapping value types to
Hibernate types using heuristics.
|
QueryImplementor<X> |
setProperties(Object bean)
Bind the property values of the given bean to named parameters of the query,
matching property names with parameter names and mapping property types to
Hibernate types using heuristics.
|
QueryImplementor |
setReadOnly(boolean readOnly)
Set the read-only/modifiable mode for entities and proxies
loaded by this Query.
|
QueryImplementor<X> |
setResultTransformer(ResultTransformer transformer)
Set a strategy for handling the query results.
|
QueryImplementor |
setTimeout(int timeout)
Set the query timeout in seconds.
|
Stream<X> |
stream()
Retrieve a Stream over the query results.
|
X |
uniqueResult()
Convenience method to return a single instance that matches
the query, or
null if the query returns no results. |
Optional<X> |
uniqueResultOptional() |
<T> T |
unwrap(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, setBigDecimal, setBigDecimal, setBigInteger, setBigInteger, setBinary, setBinary, setBoolean, setBoolean, setByte, setByte, setCalendar, setCalendar, setCalendarDate, setCalendarDate, setCharacter, setCharacter, setDate, setDate, setDouble, setDouble, setFloat, setFloat, setInteger, setInteger, setLocale, setLocale, setLong, setLong, setParameters, setSerializable, setSerializable, setShort, setShort, setString, setString, setText, setText, setTime, setTime, setTimestamp, setTimestamp
getHibernateFirstResult, getHibernateMaxResults, setHibernateFirstResult, setHibernateMaxResults
public CriteriaQueryTypeQueryAdapter(SessionImplementor entityManager, QueryImplementor<X> jpqlQuery, Map<ParameterExpression<?>,ExplicitParameterInfo<?>> explicitParameterInfoMap)
public List<X> getResultList()
TypedQuery
getResultList
in interface Query
getResultList
in interface TypedQuery<X>
public X uniqueResult()
Query
null
if the query returns no results.public Stream<X> stream()
Query
You should call BaseStream.close()
after processing the stream
so that the underlying resources are deallocated right away.
public List<X> list()
Query
public QueryImplementor<X> setCacheMode(CacheMode cacheMode)
Query
setCacheMode
in interface BasicQueryContract<CommonQueryContract>
cacheMode
- The new CacheMode to use.this
, for method chainingQuery.getCacheMode()
public boolean isCacheable()
Query
SessionFactory
for this to happen. Usually that is
controlled by the hibernate.cache.use_query_cache
configuration setting.isCacheable
in interface BasicQueryContract<CommonQueryContract>
true
if the query results are eligible for caching, false
otherwise.AvailableSettings.USE_QUERY_CACHE
public X getSingleResult()
TypedQuery
getSingleResult
in interface Query
getSingleResult
in interface TypedQuery<X>
public ParameterMetadata getParameterMetadata()
Query
public String[] getNamedParameters()
Query
public int getMaxResults()
Query
Integer.MAX_VALUE
if setMaxResults
was not
applied to the query object.getMaxResults
in interface Query
public QueryImplementor<X> setMaxResults(int maxResult)
TypedQuery
setMaxResults
in interface Query
setMaxResults
in interface TypedQuery<X>
maxResult
- maximum number of results to retrievepublic int getFirstResult()
Query
setFirstResult
was not applied to the
query object.getFirstResult
in interface Query
public QueryImplementor<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 QueryImplementor<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 hintprotected boolean isNativeQuery()
public String getQueryString()
Query
public FlushMode getHibernateFlushMode()
Query
getHibernateFlushMode
in interface BasicQueryContract<CommonQueryContract>
FlushMode
public FlushModeType getFlushMode()
Query
getFlushMode
in interface Query
public CacheMode getCacheMode()
Query
getCacheMode
in interface BasicQueryContract<CommonQueryContract>
Session.getCacheMode()
,
CacheMode
public Type[] getReturnTypes()
Query
getReturnTypes
in interface BasicQueryContract<CommonQueryContract>
public LockOptions getLockOptions()
Query
LockOptions
public RowSelection getQueryOptions()
Query
public QueryImplementor<X> setFlushMode(FlushModeType flushModeType)
TypedQuery
setFlushMode
in interface Query
setFlushMode
in interface TypedQuery<X>
flushModeType
- flush modepublic QueryImplementor setFlushMode(FlushMode flushMode)
Query
setFlushMode
in interface BasicQueryContract<CommonQueryContract>
flushMode
- The new FlushMode to use.this
, for method chainingQuery.getHibernateFlushMode()
public QueryImplementor<X> setHibernateFlushMode(FlushMode flushMode)
Query
setHibernateFlushMode
in interface BasicQueryContract<CommonQueryContract>
flushMode
- The new FlushMode to use.this
, for method chainingQuery.getHibernateFlushMode()
public QueryImplementor setCacheable(boolean cacheable)
Query
setCacheable
in interface BasicQueryContract<CommonQueryContract>
cacheable
- Should the query results be cacheable?this
, for method chainingQuery.isCacheable()
public String getCacheRegion()
Query
Query.isCacheable()
for more information). null
indicates that the
default region should be used.getCacheRegion
in interface BasicQueryContract<CommonQueryContract>
null
indicates
the default region.public QueryImplementor setCacheRegion(String cacheRegion)
Query
setCacheRegion
in interface BasicQueryContract<CommonQueryContract>
cacheRegion
- the name of a query cache region, or null
to indicate that the default region
should be used.this
, for method chainingQuery.getCacheRegion()
public Integer getTimeout()
Query
Statement.setQueryTimeout(int)
. Zero indicates no timeout.getTimeout
in interface BasicQueryContract<CommonQueryContract>
Statement.getQueryTimeout()
,
Statement.setQueryTimeout(int)
public QueryImplementor setTimeout(int timeout)
Query
setTimeout
in interface BasicQueryContract<CommonQueryContract>
timeout
- the timeout in secondsthis
, for method chainingQuery.getTimeout()
public Integer getFetchSize()
Query
Statement.setFetchSize(int)
. As defined b y JDBC, this value is a hint to the
driver to indicate how many rows to fetch from the database when more rows are needed.
NOTE : JDBC expressly defines this value as a hint. It may or may not have any effect on the actual
query execution and ResultSet processing depending on the driver.getFetchSize
in interface BasicQueryContract<CommonQueryContract>
Statement.getFetchSize()
,
Statement.setFetchSize(int)
public QueryImplementor setLockOptions(LockOptions lockOptions)
Query
Query.setLockMode(String, LockMode)
.lockOptions
- The lock options to apply to the query.this
, for method chainingQuery.getLockOptions()
public QueryImplementor setLockMode(String alias, LockMode lockMode)
Query
LockOptions
.
The effect of these alias-specific LockModes is somewhat dependent on the driver/database in use. Generally
speaking, for maximum portability, this method should only be used to mark that the rows corresponding to
the given alias should be included in pessimistic locking (LockMode.PESSIMISTIC_WRITE
).alias
- a query alias, or "this"
for a collection filterlockMode
- The lock mode to apply.this
, for method chainingQuery.getLockOptions()
public String getComment()
Query
hibernate.use_sql_comments
config setting), this comment will also be added
to the SQL query sent to the database. Often useful for identifying the source of troublesome queries on the
database side.public QueryImplementor setComment(String comment)
Query
comment
- The human-readable commentthis
, for method chainingQuery.getComment()
public QueryImplementor addQueryHint(String hint)
Query
QueryHint
, which is specific
to the JPA implementation and ignores DB vendor-specific hints. Instead, these are intended solely for the
vendor-specific hints, such as Oracle's optimizers. Multiple query hints are supported; the Dialect will
determine concatenation and placement.hint
- The database specific query hint to add.public Iterator<X> iterate()
Query
public ScrollableResults scroll()
Query
You should call ScrollableResults.close()
after processing the ScrollableResults
so that the underlying resources are deallocated right away.
ScrollableResults
public ScrollableResults scroll(ScrollMode scrollMode)
Query
You should call ScrollableResults.close()
after processing the ScrollableResults
so that the underlying resources are deallocated right away.
scrollMode
- The scroll modeScrollableResults
,
ScrollMode
public QueryImplementor setFetchSize(int fetchSize)
Query
setFetchSize
in interface BasicQueryContract<CommonQueryContract>
fetchSize
- the fetch size hintthis
, for method chainingQuery.getFetchSize()
public boolean isReadOnly()
Query
isReadOnly
in interface BasicQueryContract<CommonQueryContract>
true
if the entities and proxies loaded by the query will be put
in read-only mode; false
otherwise (they will be modifiable)Query.setReadOnly(boolean)
,
The read-only/modifiable setting has no impact on entities/proxies returned by the
query that existed in the session before the query was executed.
public LockModeType getLockMode()
Query
getLockMode
in interface Query
public QueryImplementor<X> setLockMode(LockModeType lockModeType)
TypedQuery
setLockMode
in interface Query
setLockMode
in interface TypedQuery<X>
lockModeType
- lock modepublic QueryImplementor setReadOnly(boolean readOnly)
Query
setReadOnly
in interface BasicQueryContract<CommonQueryContract>
readOnly
- true
indicates that entities and proxies loaded by the query
are to be put in read-only mode; false
indicates that entities and proxies
loaded by the query will be put in modifiable modethis
, for method chainingTo set the default read-only/modifiable setting used for
entities and proxies that are loaded into the session:
,
PersistenceContext.setDefaultReadOnly(boolean)
,
Read-only entities are not dirty-checked and snapshots of persistent
state are not maintained. Read-only entities can be modified, but
changes are not persisted.
When a proxy is initialized, the loaded entity will have the same
read-only/modifiable setting as the uninitialized
proxy has, regardless of the session's current setting.
The read-only/modifiable setting has no impact on entities/proxies
returned by the query that existed in the session before the query was executed.
public Type determineProperBooleanType(int position, Object value, Type defaultType)
public Type determineProperBooleanType(String name, Object value, Type defaultType)
public String[] getReturnAliases()
public 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> QueryImplementor<X> setParameter(Parameter<T> param, T t)
TypedQuery
Parameter
object.setParameter
in interface Query
setParameter
in interface TypedQuery<X>
param
- parameter objectt
- parameter valuepublic QueryImplementor<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 QueryImplementor<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 QueryImplementor<X> setParameter(String name, Object value)
TypedQuery
setParameter
in interface Query
setParameter
in interface TypedQuery<X>
name
- parameter namevalue
- parameter valuepublic QueryImplementor<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 QueryImplementor<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 QueryImplementor<X> setEntity(String name, Object val)
Query
Query.setParameter(String, Object)
for null values.name
- the name of the parameterval
- a non-null instance of a persistent classthis
, for method chainingpublic QueryImplementor<X> setParameter(String name, Object val, Type type)
Query
name
- the name of the parameterval
- the possibly-null parameter valuetype
- the Hibernate typethis
, for method chainingpublic <T> QueryImplementor<X> setParameter(QueryParameter<T> parameter, T val)
Query
Query.setParameter(QueryParameter, Object, Type)
should be used insteadparameter
- The query parameter mementoval
- the possibly-null parameter valuethis
, for method chainingpublic <P> QueryImplementor<X> setParameter(QueryParameter<P> parameter, P val, TemporalType temporalType)
Query
parameter
- The query parameter mementoval
- the possibly-null parameter valuetemporalType
- the temporal-type to use in binding the date/timethis
, for method chainingpublic <P> QueryImplementor<X> setParameter(String name, P val, TemporalType temporalType)
Query
name
- the parameter nameval
- the possibly-null parameter valuetemporalType
- the temporal-type to use in binding the date/timethis
, for method chainingpublic <P> QueryImplementor<X> setParameterList(QueryParameter<P> parameter, Collection<P> values)
Query
parameter
- the parameter mementovalues
- a collection of values to listthis
, for method chainingpublic QueryImplementor<X> setParameterList(String name, Collection values)
Query
name
- the name of the parametervalues
- a collection of values to listthis
, for method chainingpublic Query<X> setParameterList(int position, Collection values)
public QueryImplementor<X> setParameterList(String name, Collection values, Type type)
Query
name
- the name of the parametervalues
- a collection of values to listtype
- the Hibernate type of the valuesthis
, for method chainingpublic Query<X> setParameterList(int position, Collection values, Type type)
public QueryImplementor<X> setParameterList(String name, Object[] values, Type type)
Query
name
- the name of the parametervalues
- a collection of values to listtype
- the Hibernate type of the valuesthis
, for method chainingpublic QueryImplementor<X> setParameterList(String name, Object[] values)
Query
name
- the name of the parametervalues
- a collection of values to listthis
, for method chainingpublic <P> QueryImplementor<X> setParameter(QueryParameter<P> parameter, P value, Type type)
Query
parameter
- The query parameter mementovalue
- the possibly-null parameter valuetype
- the Hibernate typethis
, for method chainingpublic QueryImplementor<X> setParameter(Parameter<Instant> param, Instant value, TemporalType temporalType)
public QueryImplementor<X> setParameter(Parameter<LocalDateTime> param, LocalDateTime value, TemporalType temporalType)
public QueryImplementor<X> setParameter(Parameter<ZonedDateTime> param, ZonedDateTime value, TemporalType temporalType)
public QueryImplementor<X> setParameter(Parameter<OffsetDateTime> param, OffsetDateTime value, TemporalType temporalType)
public QueryImplementor<X> setParameter(String name, Instant value, TemporalType temporalType)
public QueryImplementor<X> setParameter(String name, LocalDateTime value, TemporalType temporalType)
public QueryImplementor<X> setParameter(String name, ZonedDateTime value, TemporalType temporalType)
public QueryImplementor<X> setParameter(String name, OffsetDateTime value, TemporalType temporalType)
public QueryImplementor<X> setResultTransformer(ResultTransformer transformer)
Query
transformer
- The transformer to applypublic QueryImplementor<X> setProperties(Object bean)
Query
bean
- any JavaBean or POJOthis
, for method chainingpublic QueryImplementor setProperties(Map map)
Query
map
- a java.util.Mapthis
, for method chainingpublic QueryProducerImplementor getProducer()
Query
getProducer
in interface QueryImplementor<X>
public void setOptionalId(Serializable id)
setOptionalId
in interface QueryImplementor<X>
public void setOptionalEntityName(String entityName)
setOptionalEntityName
in interface QueryImplementor<X>
public void setOptionalObject(Object optionalObject)
setOptionalObject
in interface QueryImplementor<X>
public QueryImplementor<X> setParameter(int position, LocalDateTime value, TemporalType temporalType)
public QueryImplementor<X> setParameter(int position, Instant value, TemporalType temporalType)
public QueryImplementor<X> setParameter(int position, ZonedDateTime value, TemporalType temporalType)
public QueryImplementor<X> setParameter(int position, OffsetDateTime value, TemporalType temporalType)
public QueryImplementor<X> setParameter(int position, Object val, Type type)
Query
position
- the position of the parameter in the query
string, numbered from 0.val
- the possibly-null parameter valuetype
- the Hibernate typethis
, for method chainingpublic QueryImplementor<X> setEntity(int position, Object val)
Query
Query.setParameter(int, Object)
for null values.position
- the position of the parameter in the query
string, numbered from 0.val
- a non-null instance of a persistent classthis
, for method chainingpublic <P> QueryImplementor<X> setParameter(int position, P val, TemporalType temporalType)
Query
position
- the position of the parameter in the query
string, numbered from 0.val
- the possibly-null parameter valuetemporalType
- the temporal-type to use in binding the date/timethis
, for method chainingpublic int executeUpdate()
Query
executeUpdate
in interface Query
public QueryImplementor<X> setParameter(int i, Object o)
TypedQuery
setParameter
in interface Query
setParameter
in interface TypedQuery<X>
i
- positiono
- parameter valuepublic QueryImplementor<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 QueryImplementor<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 © 2019 JBoss by Red Hat. All rights reserved.