net.sf.hibernate.impl
Class QueryImpl

java.lang.Object
  extended bynet.sf.hibernate.impl.AbstractQueryImpl
      extended bynet.sf.hibernate.impl.QueryImpl
All Implemented Interfaces:
Query
Direct Known Subclasses:
FilterImpl

public class QueryImpl
extends AbstractQueryImpl

default implementation of the Query interface, for "ordinary" HQL queries (not collection filters)

Author:
Gavin King
See Also:
FilterImpl

Constructor Summary
QueryImpl(String queryString, SessionImplementor session)
           
 
Method Summary
 QueryParameters getQueryParameters(Map namedParams)
           
 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.
 Query setCacheable(boolean cacheable)
          Enable caching of this query result set.
 Query setCacheRegion(String cacheRegion)
          Set the name of the cache region.
 
Methods inherited from class net.sf.hibernate.impl.AbstractQueryImpl
bindParameterLists, getNamedParameterLists, getNamedParameters, getNamedParams, getQueryString, getReturnTypes, getRowSelection, getSelection, getTypes, getValues, setBigDecimal, setBigDecimal, setBinary, setBinary, setBoolean, setBoolean, setByte, setByte, setCalendar, setCalendar, setCalendarDate, setCalendarDate, setCharacter, setCharacter, setDate, setDate, setDouble, setDouble, setEntity, setEntity, setEnum, setEnum, setFirstResult, setFloat, setFloat, setInteger, setInteger, setLocale, setLocale, setLockMode, setLong, setLong, setMaxResults, setParameter, setParameter, setParameter, setParameter, setParameterList, setParameterList, setParameterList, setParameterList, setProperties, setSerializable, setSerializable, setShort, setShort, setString, setString, setText, setText, setTime, setTime, setTimeout, setTimestamp, setTimestamp, typeArray, uniqueResult, valueArray, verifyParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryImpl

public QueryImpl(String queryString,
                 SessionImplementor session)
Method Detail

iterate

public Iterator iterate()
                 throws HibernateException
Description copied from interface: Query
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.

Returns:
the result iterator
Throws:
HibernateException

scroll

public ScrollableResults scroll()
                         throws HibernateException
Description copied from interface: Query
Return the query results as ScrollableResults. The scrollability of the returned results depends upon JDBC driver support for scrollable ResultSets.

Entities returned as results are initialized on demand. The first SQL query returns identifier only.

Returns:
the result iterator
Throws:
HibernateException
See Also:
ScrollableResults

list

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

Returns:
the result list
Throws:
HibernateException

setCacheable

public Query setCacheable(boolean cacheable)
Description copied from interface: Query
Enable caching of this query result set.


setCacheRegion

public Query setCacheRegion(String cacheRegion)
Description copied from interface: Query
Set the name of the cache region.

Parameters:
cacheRegion - the name of a query cache region, or null for the default query cache

getQueryParameters

public QueryParameters getQueryParameters(Map namedParams)
Overrides:
getQueryParameters in class AbstractQueryImpl