org.hibernate.Session#createQuery(java.lang.String) , org.hibernate.ScrollableResults
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: The number of entities updated or deleted.Execute the update or delete statement. |
| public String[] | Returns: the parameter names, in no particular orderReturn the names of all named parameters of the query. |
| public String | |
| public String[] | Returns: an array of aliases as stringsReturn the HQL select clause aliases (if any) |
| public Type[] | |
| public boolean | Returns: true, entities and proxies loaded by the query will be put in read-only mode false, entities and proxies loaded by the query will be put in modifiable modeShould entities and proxies loaded by this Query be put in read-only mode? |
| public Iterator | |
| public List | |
| public ScrollableResults | |
| public ScrollableResults | Returns: the result iteratorReturn the query results as ScrollableResults. |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Query | setCacheable(boolean
Should the query results be cacheable? cacheable)Enable caching of this query result set. |
| public Query | |
| public Query | setCacheRegion(String
the name of a query cache region, or null
for the default query cache cacheRegion)Set the name of the cache region. |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Query | setLockMode(String
a query alias, or this for a collection filter alias, LockMode lockMode)Set the lockmode for the objects idententified by the given alias that appears in the FROM clause. |
| public Query | setLockOptions(LockOptions lockOptions)
Set the lock options for the objects idententified by the given alias that appears in the FROM clause. |
| public Query | |
| public Query | |
| public Query | |
| public Query | setParameter(int
the position of the parameter in the query
string, numbered from 0. position, Object the possibly-null parameter value val, Type the Hibernate type type)Bind a value to a JDBC-style query parameter. |
| public Query | setParameter(String
the name of the parameter name, Object the possibly-null parameter value val, Type the Hibernate type type)Bind a value to a named query parameter. |
| public Query | setParameter(int
the position of the parameter in the query
string, numbered from 0. position, Object the non-null parameter value val)Bind a value to a JDBC-style query parameter. |
| public Query | setParameter(String
the name of the parameter name, Object the non-null parameter value val)Bind a value to a named query parameter. |
| public Query | setParameterList(String
the name of the parameter name, Collection<E> a collection of values to list vals, Type the Hibernate type of the values type)Bind multiple values to a named query parameter. |
| public Query | setParameterList(String
the name of the parameter name, Collection<E> a collection of values to list vals)Bind multiple values to a named query parameter. |
| public Query | setParameterList(String
the name of the parameter name, Object[] a collection of values to list vals, Type the Hibernate type of the values type)Bind multiple values to a named query parameter. |
| public Query | setParameterList(String
the name of the parameter name, Object[] a collection of values to list vals)Bind multiple values to a named query parameter. |
| public Query | |
| public Query | setProperties(Object
any 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 hueristics. |
| public Query | setProperties(Map<K, V>
a java.util.Map bean)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 hueristics. |
| public Query | setReadOnly(boolean
true, entities and proxies loaded by the query will be put in read-only mode
false, entities and proxies loaded by the query will be put in modifiable mode readOnly)Set the read-only/modifiable mode for entities and proxies loaded by this Query. |
| public Query | Returns: this (for method chaining)The transformer to apply transformer)Set a strategy for handling the query results. |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Query | |
| public Object | Returns: the single result or nullConvenience method to return a single instance that matches the query, or null if the query returns no results. |
| executeUpdate | back to summary |
|---|---|
| public int executeUpdate() throws HibernateException Execute the update or delete statement. The semantics are compliant with the ejb3 Query.executeUpdate() method.
| |
| getNamedParameters | back to summary |
|---|---|
| public String[] getNamedParameters() throws HibernateException Return the names of all named parameters of the query.
| |
| getQueryString | back to summary |
|---|---|
| public String getQueryString() Get the query string.
| |
| getReturnAliases | back to summary |
|---|---|
| public String[] getReturnAliases() throws HibernateException Return the HQL select clause aliases (if any)
| |
| getReturnTypes | back to summary |
|---|---|
| public Type[] getReturnTypes() throws HibernateException Return the Hibernate types of the query result set.
| |
| isReadOnly | back to summary |
|---|---|
| public 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.
| |
| iterate | back to summary |
|---|---|
| public Iterator Return the query results as an Iterator. If the query
contains multiple results pre row, the results are returned in
an instance of Object[].
| |
| list | back to summary |
|---|---|
| public List Return the query results as a List. If the query contains multiple results pre row, the results are returned in an instance of Object[].
| |
| scroll | back to summary |
|---|---|
| public ScrollableResults scroll() throws HibernateException Return the query results as ScrollableResults. The
scrollability of the returned results depends upon JDBC driver
support for scrollable ResultSets.
| |
| scroll | back to summary |
|---|---|
| public ScrollableResults scroll(ScrollMode scrollMode) throws HibernateException Return the query results as ScrollableResults. The
scrollability of the returned results depends upon JDBC driver
support for scrollable ResultSets.
| |
| setBigDecimal | back to summary |
|---|---|
| public Query setBigDecimal(int position, BigDecimal number) | |
| setBigDecimal | back to summary |
|---|---|
| public Query setBigDecimal(String name, BigDecimal number) | |
| setBigInteger | back to summary |
|---|---|
| public Query setBigInteger(int position, BigInteger number) | |
| setBigInteger | back to summary |
|---|---|
| public Query setBigInteger(String name, BigInteger number) | |
| setBinary | back to summary |
|---|---|
| public Query setBinary(int position, byte[] val) | |
| setBinary | back to summary |
|---|---|
| public Query setBinary(String name, byte[] val) | |
| setBoolean | back to summary |
|---|---|
| public Query setBoolean(int position, boolean val) | |
| setBoolean | back to summary |
|---|---|
| public Query setBoolean(String name, boolean val) | |
| setByte | back to summary |
|---|---|
| public Query setByte(int position, byte val) | |
| setByte | back to summary |
|---|---|
| public Query setByte(String name, byte val) | |
| setCacheable | back to summary |
|---|---|
| public Query setCacheable(boolean cacheable) Enable caching of this query result set.
| |
| setCacheMode | back to summary |
|---|---|
| public Query setCacheMode(CacheMode cacheMode) Override the current session cache mode, just for this query.
| |
| setCacheRegion | back to summary |
|---|---|
| public Query setCacheRegion(String cacheRegion) Set the name of the cache region.
| |
| setCalendar | back to summary |
|---|---|
| public Query setCalendar(int position, Calendar calendar) | |
| setCalendar | back to summary |
|---|---|
| public Query setCalendar(String name, Calendar calendar) | |
| setCalendarDate | back to summary |
|---|---|
| public Query setCalendarDate(int position, Calendar calendar) | |
| setCalendarDate | back to summary |
|---|---|
| public Query setCalendarDate(String name, Calendar calendar) | |
| setCharacter | back to summary |
|---|---|
| public Query setCharacter(int position, char val) | |
| setCharacter | back to summary |
|---|---|
| public Query setCharacter(String name, char val) | |
| setComment | back to summary |
|---|---|
| public Query setComment(String comment) Add a comment to the generated SQL.
| |
| setDate | back to summary |
|---|---|
| public Query setDate(int position, Date date) | |
| setDate | back to summary |
|---|---|
| public Query setDate(String name, Date date) | |
| setDouble | back to summary |
|---|---|
| public Query setDouble(int position, double val) | |
| setDouble | back to summary |
|---|---|
| public Query setDouble(String name, double val) | |
| setEntity | back to summary |
|---|---|
| public Query setEntity(int position, Object val) Bind an instance of a mapped persistent class to a JDBC-style query parameter.
| |
| setEntity | back to summary |
|---|---|
| public Query setEntity(String name, Object val) Bind an instance of a mapped persistent class to a named query parameter. | |
| setFetchSize | back to summary |
|---|---|
| public Query setFetchSize(int fetchSize) Set a fetch size for the underlying JDBC query.
| |
| setFirstResult | back to summary |
|---|---|
| public Query setFirstResult(int firstResult) Set the first row to retrieve. If not set, rows will be retrieved beginnning from row 0.
| |
| setFloat | back to summary |
|---|---|
| public Query setFloat(int position, float val) | |
| setFloat | back to summary |
|---|---|
| public Query setFloat(String name, float val) | |
| setFlushMode | back to summary |
|---|---|
| public Query setFlushMode(FlushMode flushMode) Override the current session flush mode, just for this query.
| |
| setInteger | back to summary |
|---|---|
| public Query setInteger(int position, int val) | |
| setInteger | back to summary |
|---|---|
| public Query setInteger(String name, int val) | |
| setLocale | back to summary |
|---|---|
| public Query setLocale(int position, Locale locale) | |
| setLocale | back to summary |
|---|---|
| public Query setLocale(String name, Locale locale) | |
| setLockMode | back to summary |
|---|---|
| public Query setLockMode(String alias, LockMode lockMode) Set the lockmode for the objects idententified by the given alias that appears in the FROM clause.
| |
| setLockOptions | back to summary |
|---|---|
| public Query setLockOptions(LockOptions lockOptions) Set the lock options for the objects idententified by the given alias that appears in the FROM clause. | |
| setLong | back to summary |
|---|---|
| public Query setLong(int position, long val) | |
| setLong | back to summary |
|---|---|
| public Query setLong(String name, long val) | |
| setMaxResults | back to summary |
|---|---|
| public Query setMaxResults(int maxResults) Set the maximum number of rows to retrieve. If not set, there is no limit to the number of rows retrieved.
| |
| setParameter | back to summary |
|---|---|
| public Query setParameter(int position, Object val, Type type) Bind a value to a JDBC-style query parameter. | |
| setParameter | back to summary |
|---|---|
| public Query setParameter(String name, Object val, Type type) Bind a value to a named query parameter. | |
| setParameter | back to summary |
|---|---|
| public Query setParameter(int position, Object val) throws HibernateException Bind a value to a JDBC-style query parameter. The Hibernate type of the parameter is first detected via the usage/position in the query and if not sufficient secondly guessed from the class of the given object.
| |
| setParameter | back to summary |
|---|---|
| public Query setParameter(String name, Object val) throws HibernateException Bind a value to a named query parameter. The Hibernate type of the parameter is first detected via the usage/position in the query and if not sufficient secondly guessed from the class of the given object.
| |
| setParameterList | back to summary |
|---|---|
| public Query setParameterList(String name, Collection<E> vals, Type type) throws HibernateException Bind multiple values to a named query parameter. This is useful for binding a list of values to an expression such as foo.bar in (:value_list).
| |
| setParameterList | back to summary |
|---|---|
| public Query setParameterList(String name, Collection<E> vals) throws HibernateException Bind multiple values to a named query parameter. The Hibernate type of the parameter is first detected via the usage/position in the query and if not sufficient secondly guessed from the class of the first object in the collection. This is useful for binding a list of values to an expression such as foo.bar in (:value_list).
| |
| setParameterList | back to summary |
|---|---|
| public Query setParameterList(String name, Object[] vals, Type type) throws HibernateException Bind multiple values to a named query parameter. This is useful for binding a list of values to an expression such as foo.bar in (:value_list). | |
| setParameterList | back to summary |
|---|---|
| public Query setParameterList(String name, Object[] vals) throws HibernateException Bind multiple values to a named query parameter. The Hibernate type of the parameter is first detected via the usage/position in the query and if not sufficient secondly guessed from the class of the first object in the array. This is useful for binding a list of values to an expression such as foo.bar in (:value_list). | |
| setParameters | back to summary |
|---|---|
| public Query setParameters(Object[] values, Type[] types) throws HibernateException Bind values and types to positional parameters. | |
| setProperties | back to summary |
|---|---|
| public Query setProperties(Object bean) throws HibernateException 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 hueristics.
| |
| setProperties | back to summary |
|---|---|
| public Query setProperties(Map<K, V> bean) throws HibernateException 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 hueristics.
| |
| setResultTransformer | back to summary |
|---|---|
| public Query setResultTransformer(ResultTransformer transformer) Set a strategy for handling the query results. This can be used to change "shape" of the query result.
| |
| setSerializable | back to summary |
|---|---|
| public Query setSerializable(int position, Serializable val) | |
| setSerializable | back to summary |
|---|---|
| public Query setSerializable(String name, Serializable val) | |
| setShort | back to summary |
|---|---|
| public Query setShort(int position, short val) | |
| setShort | back to summary |
|---|---|
| public Query setShort(String name, short val) | |
| setString | back to summary |
|---|---|
| public Query setString(int position, String val) | |
| setString | back to summary |
|---|---|
| public Query setString(String name, String val) | |
| setText | back to summary |
|---|---|
| public Query setText(int position, String val) | |
| setText | back to summary |
|---|---|
| public Query setText(String name, String val) | |
| setTime | back to summary |
|---|---|
| public Query setTime(int position, Date date) | |
| setTime | back to summary |
|---|---|
| public Query setTime(String name, Date date) | |
| setTimeout | back to summary |
|---|---|
| public Query setTimeout(int timeout) Set a timeout for the underlying JDBC query.
| |
| setTimestamp | back to summary |
|---|---|
| public Query setTimestamp(int position, Date date) | |
| setTimestamp | back to summary |
|---|---|
| public Query setTimestamp(String name, Date date) | |
| uniqueResult | back to summary |
|---|---|
| public Object uniqueResult() throws HibernateException Convenience method to return a single instance that matches the query, or null if the query returns no results.
| |