Queries may have parameters, either ordinal or named, and the various
setParameter() operations of this interface allow an argument to be
bound to a parameter. It's not usually necessary to explicitly specify the type
of an argument, but in rare cases where this is needed, TypedParameterValue
may be used.
The operation setFlushMode(FlushModeType) allows a temporary flush
mode to be specified, which is in effect only during the execution of this query.
Setting the flush mode at the query level does not affect
the flush mode of other operations performed via the parent session. This operation is usually used as follows:
query.setFlushMode(COMMIT).getResultList()
The call to setFlushMode(COMMIT) disables the usual automatic flush
operation that occurs before query execution.
jakarta.persistence.Query , SelectionQuery, MutationQuery
| Modifier and Type | Method and Description |
|---|---|
| public String | |
| public FlushModeType | |
| public FlushMode | |
| public Integer | |
| public CommonQueryContract | |
| public CommonQueryContract | |
| public CommonQueryContract | |
| public CommonQueryContract | |
| public CommonQueryContract | |
| public <P> CommonQueryContract | setParameter(String parameter, P value, Class<P> type)
Bind the given argument to a named query parameter using the given
|
| public <P> CommonQueryContract | setParameter(String parameter, P value, BindableType<P> type)
Bind the given argument to a named query parameter using the given
|
| public CommonQueryContract | setParameter(String parameter, Instant value, TemporalType temporalType)
Bind an |
| public CommonQueryContract | |
| public CommonQueryContract | |
| public CommonQueryContract | |
| public <P> CommonQueryContract | setParameter(int parameter, P value, Class<P> type)
Bind the given argument to an ordinal query parameter using the given
|
| public <P> CommonQueryContract | setParameter(int parameter, P value, BindableType<P> type)
Bind the given argument to an ordinal query parameter using the given
|
| public CommonQueryContract | setParameter(int parameter, Instant value, TemporalType temporalType)
Bind an |
| public CommonQueryContract | |
| public CommonQueryContract | |
| public <T> CommonQueryContract | Returns: this, for method chainingthe query parameter memento parameter, T the argument, which might be null value)Bind an argument to the query parameter represented by the given
|
| public <P> CommonQueryContract | Returns: this, for method chainingthe query parameter memento parameter, P the argument, which might be null value, Class<P> a type)BindableType representing the type of the parameterBind an argument to the query parameter represented by the given
|
| public <P> CommonQueryContract | Returns: this, for method chainingthe query parameter memento parameter, P the argument, which might be null val, BindableType<P> a type)BindableType representing the type of the parameterBind an argument to the query parameter represented by the given
|
| public <T> CommonQueryContract | |
| public CommonQueryContract | |
| public CommonQueryContract | |
| public CommonQueryContract | Returns: this, for method chainingBind multiple arguments to a named query parameter. |
| public <P> CommonQueryContract | Returns: this, for method chainingBind multiple arguments to a named query parameter using the given
|
| public <P> CommonQueryContract | Returns: this, for method chainingBind multiple arguments to a named query parameter using the given
|
| public CommonQueryContract | Returns: this, for method chainingBind multiple arguments to a named query parameter. |
| public <P> CommonQueryContract | Returns: this, for method chainingBind multiple arguments to a named query parameter using the given
Class reference to attempt to determine the |
| public <P> CommonQueryContract | Returns: this, for method chainingBind multiple arguments to a named query parameter using the given
|
| public CommonQueryContract | Returns: this, for method chainingBind multiple arguments to an ordinal query parameter. |
| public <P> CommonQueryContract | Returns: this, for method chainingBind multiple arguments to an ordinal query parameter using the given
|
| public <P> CommonQueryContract | Returns: this, for method chainingBind multiple arguments to an ordinal query parameter using the given
|
| public CommonQueryContract | Returns: this, for method chainingBind multiple arguments to an ordinal query parameter. |
| public <P> CommonQueryContract | Returns: this, for method chainingBind multiple arguments to an ordinal query parameter using the given
|
| public <P> CommonQueryContract | Returns: this, for method chainingBind multiple arguments to an ordinal query parameter using the given
|
| public <P> CommonQueryContract | Returns: this, for method chainingthe parameter memento parameter, Collection<? extends P> a collection of arguments values)Bind multiple arguments to the query parameter represented by the
given |
| public <P> CommonQueryContract | Returns: this, for method chainingBind multiple arguments to the query parameter represented by the
given |
| public <P> CommonQueryContract | Returns: this, for method chainingBind multiple arguments to the query parameter represented by the
given |
| public <P> CommonQueryContract | Returns: this, for method chainingthe parameter memento parameter, P[] a collection of arguments values)Bind multiple arguments to the query parameter represented by the
given |
| public <P> CommonQueryContract | Returns: this, for method chainingBind multiple arguments to the query parameter represented by the
given |
| public <P> CommonQueryContract | Returns: this, for method chainingBind multiple arguments to the query parameter represented by the
given |
| public CommonQueryContract | Returns: this, for method chainingany JavaBean or POJO 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. |
| public CommonQueryContract | Returns: this, for method chaininga bean)Map of names to argumentsBind the values of the given |
| public CommonQueryContract | Returns: this, for method chainingthe timeout in seconds timeout)Set the query timeout in seconds. |
| getComment | back to summary |
|---|---|
| public String getComment() Get the comment that has been set for this query, if any. | |
| getFlushMode | back to summary |
|---|---|
| public FlushModeType getFlushMode() The JPA | |
| getHibernateFlushMode | back to summary |
|---|---|
| public FlushMode getHibernateFlushMode() The
| |
| getTimeout | back to summary |
|---|---|
| public Integer getTimeout() Obtain the query timeout in seconds.
This value is eventually passed along to the JDBC statement via
A value of zero indicates no timeout. | |
| setComment | back to summary |
|---|---|
| public CommonQueryContract setComment(String comment) Set a comment for this query.
| |
| setFlushMode | back to summary |
|---|---|
| public CommonQueryContract setFlushMode(FlushModeType flushMode) Set the Implementation Note Setting to | |
| setHibernateFlushMode | back to summary |
|---|---|
| public CommonQueryContract setHibernateFlushMode(FlushMode flushMode) Set the current Implementation Note Setting to | |
| setHint | back to summary |
|---|---|
| public CommonQueryContract setHint(String hintName, Object value) Set a hint. The hints understood by Hibernate are enumerated by
| |
| setParameter | back to summary |
|---|---|
| public CommonQueryContract setParameter(String parameter, Object value) Bind the given argument to a named query parameter. If the type of the parameter cannot be inferred from the context in which it occurs, use one of the forms which accepts a "type". | |
| setParameter | back to summary |
|---|---|
| public <P> CommonQueryContract setParameter(String parameter, P value, Class<P> type) Bind the given argument to a named query parameter using the given
| |
| setParameter | back to summary |
|---|---|
| public <P> CommonQueryContract setParameter(String parameter, P value, BindableType<P> type) Bind the given argument to a named query parameter using the given
| |
| setParameter | back to summary |
|---|---|
| public CommonQueryContract setParameter(String parameter, Instant value, TemporalType temporalType) Bind an | |
| setParameter | back to summary |
|---|---|
| public CommonQueryContract setParameter(String parameter, Calendar value, TemporalType temporalType) | |
| setParameter | back to summary |
|---|---|
| public CommonQueryContract setParameter(String parameter, Date value, TemporalType temporalType) | |
| setParameter | back to summary |
|---|---|
| public CommonQueryContract setParameter(int parameter, Object value) Bind the given argument to an ordinal query parameter. If the type of the parameter cannot be inferred from the context in which it occurs, use one of the forms which accepts a "type". | |
| setParameter | back to summary |
|---|---|
| public <P> CommonQueryContract setParameter(int parameter, P value, Class<P> type) Bind the given argument to an ordinal query parameter using the given
| |
| setParameter | back to summary |
|---|---|
| public <P> CommonQueryContract setParameter(int parameter, P value, BindableType<P> type) Bind the given argument to an ordinal query parameter using the given
| |
| setParameter | back to summary |
|---|---|
| public CommonQueryContract setParameter(int parameter, Instant value, TemporalType temporalType) Bind an | |
| setParameter | back to summary |
|---|---|
| public CommonQueryContract setParameter(int parameter, Date value, TemporalType temporalType) | |
| setParameter | back to summary |
|---|---|
| public CommonQueryContract setParameter(int parameter, Calendar value, TemporalType temporalType) | |
| setParameter | back to summary |
|---|---|
| public <T> CommonQueryContract setParameter(QueryParameter<T> parameter, T value) Bind an argument to the query parameter represented by the given
If the type of the parameter cannot be inferred from the context in which it occurs, use one of the forms which accepts a "type".
| |
| setParameter | back to summary |
|---|---|
| public <P> CommonQueryContract setParameter(QueryParameter<P> parameter, P value, Class<P> type) Bind an argument to the query parameter represented by the given
| |
| setParameter | back to summary |
|---|---|
| public <P> CommonQueryContract setParameter(QueryParameter<P> parameter, P val, BindableType<P> type) Bind an argument to the query parameter represented by the given
| |
| setParameter | back to summary |
|---|---|
| public <T> CommonQueryContract setParameter(Parameter<T> param, T value) | |
| setParameter | back to summary |
|---|---|
| public CommonQueryContract setParameter(Parameter<Calendar> param, Calendar value, TemporalType temporalType) | |
| setParameter | back to summary |
|---|---|
| public CommonQueryContract setParameter(Parameter<Date> param, Date value, TemporalType temporalType) | |
| setParameterList | back to summary |
|---|---|
| public CommonQueryContract setParameterList(String parameter, Collection<E> values) Bind multiple arguments to a named query parameter. The "type mapping" for the binding is inferred from the type of the first collection element. API Note This is used for binding a list of values to an expression
such as
| |
| setParameterList | back to summary |
|---|---|
| public <P> CommonQueryContract setParameterList(String parameter, Collection<? extends P> values, Class<P> javaType) Bind multiple arguments to a named query parameter using the given
API Note This is used for binding a list of values to an expression
such as
| |
| setParameterList | back to summary |
|---|---|
| public <P> CommonQueryContract setParameterList(String parameter, Collection<? extends P> values, BindableType<P> type) Bind multiple arguments to a named query parameter using the given
API Note This is used for binding a list of values to an expression
such as
| |
| setParameterList | back to summary |
|---|---|
| public CommonQueryContract setParameterList(String parameter, Object[] values) Bind multiple arguments to a named query parameter. The "type mapping" for the binding is inferred from the type of the first collection element API Note This is used for binding a list of values to an expression
such as
| |
| setParameterList | back to summary |
|---|---|
| public <P> CommonQueryContract setParameterList(String parameter, P[] values, Class<P> javaType) Bind multiple arguments to a named query parameter using the given
Class reference to attempt to determine the API Note This is used for binding a list of values to an expression
such as
| |
| setParameterList | back to summary |
|---|---|
| public <P> CommonQueryContract setParameterList(String parameter, P[] values, BindableType<P> type) Bind multiple arguments to a named query parameter using the given
API Note This is used for binding a list of values to an expression
such as
| |
| setParameterList | back to summary |
|---|---|
| public CommonQueryContract setParameterList(int parameter, Collection<E> values) Bind multiple arguments to an ordinal query parameter. The "type mapping" for the binding is inferred from the type of the first collection element API Note This is used for binding a list of values to an expression
such as
| |
| setParameterList | back to summary |
|---|---|
| public <P> CommonQueryContract setParameterList(int parameter, Collection<? extends P> values, Class<P> javaType) Bind multiple arguments to an ordinal query parameter using the given
API Note This is used for binding a list of values to an expression
such as
| |
| setParameterList | back to summary |
|---|---|
| public <P> CommonQueryContract setParameterList(int parameter, Collection<? extends P> values, BindableType<P> type) Bind multiple arguments to an ordinal query parameter using the given
API Note This is used for binding a list of values to an expression
such as
| |
| setParameterList | back to summary |
|---|---|
| public CommonQueryContract setParameterList(int parameter, Object[] values) Bind multiple arguments to an ordinal query parameter. The "type mapping" for the binding is inferred from the type of the first collection element API Note This is used for binding a list of values to an expression
such as
| |
| setParameterList | back to summary |
|---|---|
| public <P> CommonQueryContract setParameterList(int parameter, P[] values, Class<P> javaType) Bind multiple arguments to an ordinal query parameter using the given
API Note This is used for binding a list of values to an expression
such as
| |
| setParameterList | back to summary |
|---|---|
| public <P> CommonQueryContract setParameterList(int parameter, P[] values, BindableType<P> type) Bind multiple arguments to an ordinal query parameter using the given
API Note This is used for binding a list of values to an expression
such as
| |
| setParameterList | back to summary |
|---|---|
| public <P> CommonQueryContract setParameterList(QueryParameter<P> parameter, Collection<? extends P> values) Bind multiple arguments to the query parameter represented by the
given The type of the parameter is inferred from the context in which it occurs, and from the type of the first given argument.
| |
| setParameterList | back to summary |
|---|---|
| public <P> CommonQueryContract setParameterList(QueryParameter<P> parameter, Collection<? extends P> values, Class<P> javaType) Bind multiple arguments to the query parameter represented by the
given API Note This is used for binding a list of values to an expression
such as
| |
| setParameterList | back to summary |
|---|---|
| public <P> CommonQueryContract setParameterList(QueryParameter<P> parameter, Collection<? extends P> values, BindableType<P> type) Bind multiple arguments to the query parameter represented by the
given API Note This is used for binding a list of values to an expression
such as
| |
| setParameterList | back to summary |
|---|---|
| public <P> CommonQueryContract setParameterList(QueryParameter<P> parameter, P[] values) Bind multiple arguments to the query parameter represented by the
given
The type of the parameter is inferred between the context in which it
occurs, the type associated with the
| |
| setParameterList | back to summary |
|---|---|
| public <P> CommonQueryContract setParameterList(QueryParameter<P> parameter, P[] values, Class<P> javaType) Bind multiple arguments to the query parameter represented by the
given API Note This is used for binding a list of values to an expression
such as
| |
| setParameterList | back to summary |
|---|---|
| public <P> CommonQueryContract setParameterList(QueryParameter<P> parameter, P[] values, BindableType<P> type) Bind multiple arguments to the query parameter represented by the
given API Note This is used for binding a list of values to an expression
such as
| |
| setProperties | back to summary |
|---|---|
| public CommonQueryContract 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.
| |
| setProperties | back to summary |
|---|---|
| public CommonQueryContract setProperties(Map<K, V> bean) Bind the values of the given
| |
| setTimeout | back to summary |
|---|---|
| public CommonQueryContract setTimeout(int timeout) Set the query timeout in seconds. Any value set here is eventually passed directly along to the JDBC statement, which expressly disallows negative values. So negative values should be avoided as a general rule. A value of zero indicates no timeout.
| |