org.hibernate.impl

Class QueryImpl

Implemented Interfaces:
Query
Known Direct Subclasses:
CollectionFilterImpl

public class QueryImpl
extends AbstractQueryImpl

default implementation of the Query interface, for "ordinary" HQL queries (not collection filters)
Author:
Gavin King
See Also:
CollectionFilterImpl

Field Summary

Fields inherited from class org.hibernate.impl.AbstractQueryImpl

parameterMetadata, session

Constructor Summary

QueryImpl(String queryString, FlushMode flushMode, SessionImplementor session, ParameterMetadata parameterMetadata)
QueryImpl(String queryString, SessionImplementor session, ParameterMetadata parameterMetadata)

Method Summary

int
executeUpdate()
Execute the update or delete statement.
protected Map
getLockModes()
Iterator
iterate()
Return the query results as an Iterator.
List
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.
Query
setLockMode(String alias, LockMode lockMode)
Set the lockmode for the objects idententified by the given alias that appears in the FROM clause.

Methods inherited from class org.hibernate.impl.AbstractQueryImpl

after, before, determineType, determineType, determineType, determineType, determineType, expandParameterLists, getLockModes, getNamedParameterLists, getNamedParameters, getNamedParams, getQueryParameters, getQueryString, getReturnAliases, getReturnTypes, getRowSelection, getSelection, getTypes, getValues, hasNamedParameters, isReadOnly, setBigDecimal, setBigDecimal, setBigInteger, setBigInteger, setBinary, setBinary, setBoolean, setBoolean, setByte, setByte, setCacheMode, setCacheRegion, setCacheable, setCalendar, setCalendar, setCalendarDate, setCalendarDate, setCharacter, setCharacter, setCollectionKey, setComment, setDate, setDate, setDouble, setDouble, setEntity, setEntity, setFetchSize, setFirstResult, setFloat, setFloat, setFlushMode, setInteger, setInteger, setLocale, setLocale, setLong, setLong, setMaxResults, setOptionalEntityName, setOptionalId, setOptionalObject, setParameter, setParameter, setParameter, setParameter, setParameterList, setParameterList, setParameterList, setParameterList, setParameters, setProperties, setProperties, setReadOnly, setResultTransformer, setSerializable, setSerializable, setShort, setShort, setString, setString, setText, setText, setTime, setTime, setTimeout, setTimestamp, setTimestamp, toString, typeArray, uniqueResult, valueArray, verifyParameters, verifyParameters

Constructor Details

QueryImpl

public QueryImpl(String queryString,
                 FlushMode flushMode,
                 SessionImplementor session,
                 ParameterMetadata parameterMetadata)

QueryImpl

public QueryImpl(String queryString,
                 SessionImplementor session,
                 ParameterMetadata parameterMetadata)

Method Details

executeUpdate

public int executeUpdate()
            throws HibernateException
Execute the update or delete statement. The semantics are compliant with the ejb3 Query.executeUpdate() method.
Specified by:
executeUpdate in interface Query
Returns:
The number of entities updated or deleted.

getLockModes

protected Map getLockModes()
Overrides:
getLockModes in interface AbstractQueryImpl

iterate

public Iterator iterate()
            throws HibernateException
Return the query results as an Iterator. If the query contains multiple results pre row, the results are returned in an instance of Object[].

Entities returned as results are initialized on demand. The first SQL query returns identifiers only.
Specified by:
iterate in interface Query
Returns:
the result iterator

list

public List list()
            throws HibernateException
Return the query results as a List. If the query contains multiple results pre row, the results are returned in an instance of Object[].
Specified by:
list in interface Query
Returns:
the result list

scroll

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.
Specified by:
scroll in interface Query
Returns:
the result iterator

scroll

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.
Specified by:
scroll in interface Query
Returns:
the result iterator

setLockMode

public Query setLockMode(String alias,
                         LockMode lockMode)
Set the lockmode for the objects idententified by the given alias that appears in the FROM clause.
Specified by:
setLockMode in interface Query
Parameters:
alias - a query alias, or this for a collection filter