org.hibernate.internal
Class QueryImpl

java.lang.Object
  extended by org.hibernate.internal.AbstractQueryImpl
      extended by org.hibernate.internal.QueryImpl
All Implemented Interfaces:
Query
Direct Known Subclasses:
CollectionFilterImpl

public class QueryImpl
extends AbstractQueryImpl

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

See Also:
CollectionFilterImpl

Field Summary
 
Fields inherited from class org.hibernate.internal.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.
 LockOptions getLockOptions()
           
 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.
 Query setLockOptions(LockOptions lockOption)
          Set the lock options for the objects idententified by the given alias that appears in the FROM clause.
 
Methods inherited from class org.hibernate.internal.AbstractQueryImpl
after, before, determineType, determineType, determineType, determineType, determineType, expandParameterLists, getCacheMode, getNamedParameterLists, getNamedParameters, getNamedParams, getParameterMetadata, getQueryParameters, getQueryString, getReturnAliases, getReturnTypes, getRowSelection, getSelection, getTypes, getValues, hasNamedParameters, isReadOnly, setBigDecimal, setBigDecimal, setBigInteger, setBigInteger, setBinary, setBinary, setBoolean, setBoolean, setByte, setByte, setCacheable, setCacheMode, setCacheRegion, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QueryImpl

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

QueryImpl

public QueryImpl(String queryString,
                 SessionImplementor session,
                 ParameterMetadata parameterMetadata)
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.

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

scroll

public ScrollableResults scroll(ScrollMode scrollMode)
                         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.

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

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

executeUpdate

public int executeUpdate()
                  throws HibernateException
Description copied from interface: Query
Execute the update or delete statement.

The semantics are compliant with the ejb3 Query.executeUpdate() method.

Returns:
The number of entities updated or deleted.
Throws:
HibernateException

setLockMode

public Query setLockMode(String alias,
                         LockMode lockMode)
Description copied from interface: Query
Set the lockmode for the objects idententified by the given alias that appears in the FROM clause.

Parameters:
alias - a query alias, or this for a collection filter

setLockOptions

public Query setLockOptions(LockOptions lockOption)
Description copied from interface: Query
Set the lock options for the objects idententified by the given alias that appears in the FROM clause.


getLockOptions

public LockOptions getLockOptions()
Specified by:
getLockOptions in class AbstractQueryImpl


Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.