org.hibernate.impl
Class SQLQueryImpl

java.lang.Object
  extended by org.hibernate.impl.AbstractQueryImpl
      extended by org.hibernate.impl.SQLQueryImpl
All Implemented Interfaces:
Query, org.hibernate.SQLQuery

public class SQLQueryImpl
extends org.hibernate.impl.AbstractQueryImpl
implements org.hibernate.SQLQuery

Implements SQL query passthrough.

 
 
   SELECT {person}.NAME AS {person.name}, {person}.AGE AS {person.age}, {person}.SEX AS {person.sex}
   FROM PERSON {person} WHERE {person}.NAME LIKE 'Hiber%'
 
 

Author:
gperrone

Field Summary
 
Fields inherited from class org.hibernate.impl.AbstractQueryImpl
parameterMetadata, session
 
Method Summary
 org.hibernate.SQLQuery addEntity(java.lang.Class entityClass)
           
 org.hibernate.SQLQuery addEntity(java.lang.String entityName)
           
 org.hibernate.SQLQuery addEntity(java.lang.String alias, java.lang.Class entityClass)
           
 org.hibernate.SQLQuery addEntity(java.lang.String alias, java.lang.Class entityClass, org.hibernate.LockMode lockMode)
           
 org.hibernate.SQLQuery addEntity(java.lang.String alias, java.lang.String entityName)
           
 org.hibernate.SQLQuery addEntity(java.lang.String alias, java.lang.String entityName, org.hibernate.LockMode lockMode)
           
 org.hibernate.SQLQuery addJoin(java.lang.String alias, java.lang.String path)
           
 org.hibernate.SQLQuery addJoin(java.lang.String alias, java.lang.String path, org.hibernate.LockMode lockMode)
           
 org.hibernate.SQLQuery addScalar(java.lang.String columnAlias)
           
 org.hibernate.SQLQuery addScalar(java.lang.String columnAlias, org.hibernate.type.Type type)
           
 org.hibernate.SQLQuery addSynchronizedEntityClass(java.lang.Class entityClass)
           
 org.hibernate.SQLQuery addSynchronizedEntityName(java.lang.String entityName)
           
 org.hibernate.SQLQuery addSynchronizedQuerySpace(java.lang.String querySpace)
           
 int count()
          Return the query results count without extracting it.
 int executeUpdate()
          Execute the update or delete statement.
protected  java.util.Map getLockModes()
           
 org.hibernate.engine.QueryParameters getQueryParameters(java.util.Map namedParams)
           
 java.lang.String[] getReturnAliases()
          Return the HQL select clause aliases (if any)
 org.hibernate.type.Type[] getReturnTypes()
          Return the Hibernate types of the query result set.
 java.util.Iterator iterate()
          Return the query results as an Iterator.
 java.util.List list()
          Return the query results as a List.
 org.hibernate.ScrollableResults scroll()
          Return the query results as ScrollableResults.
 org.hibernate.ScrollableResults scroll(org.hibernate.ScrollMode scrollMode)
          Return the query results as ScrollableResults.
 Query setLockMode(java.lang.String alias, org.hibernate.LockMode lockMode)
          Set the lockmode for the objects idententified by the given alias that appears in the FROM clause.
 org.hibernate.SQLQuery setResultSetMapping(java.lang.String name)
           
protected  void verifyParameters()
           
 
Methods inherited from class org.hibernate.impl.AbstractQueryImpl
after, before, determineType, determineType, determineType, determineType, determineType, expandParameterLists, getNamedParameterLists, getNamedParameters, getNamedParams, getQueryString, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.hibernate.Query
getNamedParameters, getQueryString, setBigDecimal, setBigDecimal, setBigInteger, setBigInteger, setBinary, setBinary, setBoolean, setBoolean, setByte, setByte, setCacheable, setCacheMode, setCacheRegion, setCalendar, setCalendar, setCalendarDate, setCalendarDate, setCharacter, setCharacter, setComment, setDate, setDate, setDouble, setDouble, setEntity, setEntity, setFetchSize, setFirstResult, setFloat, setFloat, setFlushMode, setInteger, setInteger, setLocale, setLocale, setLong, setLong, setMaxResults, 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, uniqueResult
 

Method Detail

list

public java.util.List list()
                    throws org.hibernate.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[].

Specified by:
list in interface Query
Returns:
the result list
Throws:
HibernateException

scroll

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

Specified by:
scroll in interface Query
Returns:
the result iterator
Throws:
HibernateException
See Also:
ScrollableResults, ScrollMode

scroll

public org.hibernate.ScrollableResults scroll()
                                       throws org.hibernate.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.

Specified by:
scroll in interface Query
Returns:
the result iterator
Throws:
HibernateException
See Also:
ScrollableResults

iterate

public java.util.Iterator iterate()
                           throws org.hibernate.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.

Specified by:
iterate in interface Query
Returns:
the result iterator
Throws:
HibernateException

getQueryParameters

public org.hibernate.engine.QueryParameters getQueryParameters(java.util.Map namedParams)
Overrides:
getQueryParameters in class org.hibernate.impl.AbstractQueryImpl

verifyParameters

protected void verifyParameters()
Overrides:
verifyParameters in class org.hibernate.impl.AbstractQueryImpl

getReturnAliases

public java.lang.String[] getReturnAliases()
                                    throws org.hibernate.HibernateException
Description copied from interface: Query
Return the HQL select clause aliases (if any)

Specified by:
getReturnAliases in interface Query
Overrides:
getReturnAliases in class org.hibernate.impl.AbstractQueryImpl
Returns:
an array of aliases as strings
Throws:
org.hibernate.HibernateException

getReturnTypes

public org.hibernate.type.Type[] getReturnTypes()
                                         throws org.hibernate.HibernateException
Description copied from interface: Query
Return the Hibernate types of the query result set.

Specified by:
getReturnTypes in interface Query
Overrides:
getReturnTypes in class org.hibernate.impl.AbstractQueryImpl
Returns:
an array of types
Throws:
org.hibernate.HibernateException

setLockMode

public Query setLockMode(java.lang.String alias,
                         org.hibernate.LockMode lockMode)
Description copied from interface: Query
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

getLockModes

protected java.util.Map getLockModes()
Specified by:
getLockModes in class org.hibernate.impl.AbstractQueryImpl

addScalar

public org.hibernate.SQLQuery addScalar(java.lang.String columnAlias,
                                        org.hibernate.type.Type type)
Specified by:
addScalar in interface org.hibernate.SQLQuery

addScalar

public org.hibernate.SQLQuery addScalar(java.lang.String columnAlias)
Specified by:
addScalar in interface org.hibernate.SQLQuery

addJoin

public org.hibernate.SQLQuery addJoin(java.lang.String alias,
                                      java.lang.String path)
Specified by:
addJoin in interface org.hibernate.SQLQuery

addEntity

public org.hibernate.SQLQuery addEntity(java.lang.Class entityClass)
Specified by:
addEntity in interface org.hibernate.SQLQuery

addEntity

public org.hibernate.SQLQuery addEntity(java.lang.String entityName)
Specified by:
addEntity in interface org.hibernate.SQLQuery

addEntity

public org.hibernate.SQLQuery addEntity(java.lang.String alias,
                                        java.lang.String entityName)
Specified by:
addEntity in interface org.hibernate.SQLQuery

addEntity

public org.hibernate.SQLQuery addEntity(java.lang.String alias,
                                        java.lang.Class entityClass)
Specified by:
addEntity in interface org.hibernate.SQLQuery

addJoin

public org.hibernate.SQLQuery addJoin(java.lang.String alias,
                                      java.lang.String path,
                                      org.hibernate.LockMode lockMode)
Specified by:
addJoin in interface org.hibernate.SQLQuery

addEntity

public org.hibernate.SQLQuery addEntity(java.lang.String alias,
                                        java.lang.String entityName,
                                        org.hibernate.LockMode lockMode)
Specified by:
addEntity in interface org.hibernate.SQLQuery

addEntity

public org.hibernate.SQLQuery addEntity(java.lang.String alias,
                                        java.lang.Class entityClass,
                                        org.hibernate.LockMode lockMode)
Specified by:
addEntity in interface org.hibernate.SQLQuery

setResultSetMapping

public org.hibernate.SQLQuery setResultSetMapping(java.lang.String name)
Specified by:
setResultSetMapping in interface org.hibernate.SQLQuery

addSynchronizedQuerySpace

public org.hibernate.SQLQuery addSynchronizedQuerySpace(java.lang.String querySpace)
Specified by:
addSynchronizedQuerySpace in interface org.hibernate.SQLQuery

addSynchronizedEntityName

public org.hibernate.SQLQuery addSynchronizedEntityName(java.lang.String entityName)
Specified by:
addSynchronizedEntityName in interface org.hibernate.SQLQuery

addSynchronizedEntityClass

public org.hibernate.SQLQuery addSynchronizedEntityClass(java.lang.Class entityClass)
Specified by:
addSynchronizedEntityClass in interface org.hibernate.SQLQuery

executeUpdate

public int executeUpdate()
                  throws org.hibernate.HibernateException
Description copied from interface: Query
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.
Throws:
HibernateException

count

public int count()
          throws org.hibernate.HibernateException
Description copied from interface: Query
Return the query results count without extracting it. It works executing a select count(*) on the given query criteria filter

Specified by:
count in interface Query
Returns:
the query filtered row count
Throws:
HibernateException
See Also:
Query.count()


Copyright © 2004-2009 The SmartWeb Team. All Rights Reserved.