Top Description Fields Methods
org.hibernate.hql

public Interface QueryTranslator

Known Direct Subinterfaces
org.hibernate.hql.FilterTranslator
Imports
org.hibernate.HibernateException, .MappingException, .QueryException, .ScrollableResults, org.hibernate.engine.QueryParameters, .SessionImplementor, org.hibernate.event.EventSource, org.hibernate.type.Type, java.util.Iterator, .List, .Map, .Set

Defines the contract of an HQL->SQL translator.
Author
josh

Field Summary

Modifier and TypeField and Description
public static final String
public static final String
public static final String
public static final String

Method Summary

Modifier and TypeMethod and Description
public List<E>
public void
compile(Map<K, V>
Defined query substitutions.
replacements
,
boolean
Does this represent a shallow (scalar or entity-id) select?
shallow
)

Compile a "normal" query.

public boolean

Returns:

true if the query does contain collection fetched; false otherwise.
containsCollectionFetches
()

Does the translated query contain collection fetches?

public int

Returns:

The number of entities updated or deleted.
executeUpdate
(QueryParameters
The query bind parameters.
queryParameters
,
SessionImplementor
The session owning this query.
session
)

Perform a bulk update/delete operation given the underlying query definition.

public String[][]

Returns:

the column names in the generated SQL.
getColumnNames
()

Returns the column names in the generated SQL.

public Class<T>
public Map<K, V>

Returns:

Filters enabled for this query execution.
getEnabledFilters
()

Returns the filters enabled for this query translator.

public ParameterTranslations

Returns:

The parameter information.
getParameterTranslations
()

Return information about any parameters encountered during translation.

public String

Returns:

the identifier
getQueryIdentifier
()

Retrieve the query identifier for this translator.

public Set<E>

Returns:

A set of query spaces (table names).
getQuerySpaces
()

Returns the set of query spaces (table names) that the query refers to.

public String

Returns:

the HQL string processed by the translator.
getQueryString
()

Returns the HQL string processed by the translator.

public String[]
getReturnAliases()

Returns an array of HQL aliases

public Type[]

Returns:

Query return types.
getReturnTypes
()

Returns an array of Types represented in the query result.

public String

Returns:

the SQL string generated by the translator.
getSQLString
()

Returns the SQL string generated by the translator.

public boolean
public Iterator<E>

Returns:

An iterator over the query results.
iterate
(QueryParameters
The query bind parameters.
queryParameters
,
EventSource
The session owning this query.
session
)

Perform an iterate operation given the underlying query definition.

public List<E>

Returns:

The query list results.
list
(SessionImplementor
The session owning this query.
session
,
QueryParameters
The query bind parameters.
queryParameters
)

Perform a list operation given the underlying query definition.

public ScrollableResults

Returns:

The ScrollableResults wrapper around the query results.
scroll
(QueryParameters
The query bind parameters.
queryParameters
,
SessionImplementor
The session owning this query.
session
)

Perform a scroll operation given the underlying query definition.

public void
validateScrollability()

Validate the scrollability of the translated query.

Field Detail

ERROR_CANNOT_DETERMINE_TYPEback to summary
public static final String ERROR_CANNOT_DETERMINE_TYPE
ERROR_CANNOT_FETCH_WITH_ITERATEback to summary
public static final String ERROR_CANNOT_FETCH_WITH_ITERATE
ERROR_CANNOT_FORMAT_LITERALback to summary
public static final String ERROR_CANNOT_FORMAT_LITERAL
ERROR_NAMED_PARAMETER_DOES_NOT_APPEARback to summary
public static final String ERROR_NAMED_PARAMETER_DOES_NOT_APPEAR

Method Detail

collectSqlStringsback to summary
public List<E> collectSqlStrings()
compileback to summary
public void compile(Map<K, V> replacements, boolean shallow) throws QueryException, MappingException

Compile a "normal" query. This method may be called multiple times. Subsequent invocations are no-ops.

Parameters
replacements:Map<K, V>

Defined query substitutions.

shallow:boolean

Does this represent a shallow (scalar or entity-id) select?

Exceptions
QueryException:
There was a problem parsing the query string.
MappingException:
There was a problem querying defined mappings.
containsCollectionFetchesback to summary
public boolean containsCollectionFetches()

Does the translated query contain collection fetches?

Returns:boolean

true if the query does contain collection fetched; false otherwise.

executeUpdateback to summary
public int executeUpdate(QueryParameters queryParameters, SessionImplementor session) throws HibernateException

Perform a bulk update/delete operation given the underlying query definition.

Parameters
queryParameters:QueryParameters

The query bind parameters.

session:SessionImplementor

The session owning this query.

Returns:int

The number of entities updated or deleted.

getColumnNamesback to summary
public String[][] getColumnNames()

Returns the column names in the generated SQL.

Returns:String[][]

the column names in the generated SQL.

getDynamicInstantiationResultTypeback to summary
public Class<T> getDynamicInstantiationResultType()
getEnabledFiltersback to summary
public Map<K, V> getEnabledFilters()

Returns the filters enabled for this query translator.

Returns:Map<K, V>

Filters enabled for this query execution.

getParameterTranslationsback to summary
public ParameterTranslations getParameterTranslations()

Return information about any parameters encountered during translation.

Returns:ParameterTranslations

The parameter information.

getQueryIdentifierback to summary
public String getQueryIdentifier()

Retrieve the query identifier for this translator. The query identifier is used in states collection.

Returns:String

the identifier

getQuerySpacesback to summary
public Set<E> getQuerySpaces()

Returns the set of query spaces (table names) that the query refers to.

Returns:Set<E>

A set of query spaces (table names).

getQueryStringback to summary
public String getQueryString()

Returns the HQL string processed by the translator.

Returns:String

the HQL string processed by the translator.

getReturnAliasesback to summary
public String[] getReturnAliases()

Returns an array of HQL aliases

getReturnTypesback to summary
public Type[] getReturnTypes()

Returns an array of Types represented in the query result.

Returns:Type[]

Query return types.

getSQLStringback to summary
public String getSQLString()

Returns the SQL string generated by the translator.

Returns:String

the SQL string generated by the translator.

isManipulationStatementback to summary
public boolean isManipulationStatement()
iterateback to summary
public Iterator<E> iterate(QueryParameters queryParameters, EventSource session) throws HibernateException

Perform an iterate operation given the underlying query definition.

Parameters
queryParameters:QueryParameters

The query bind parameters.

session:EventSource

The session owning this query.

Returns:Iterator<E>

An iterator over the query results.

listback to summary
public List<E> list(SessionImplementor session, QueryParameters queryParameters) throws HibernateException

Perform a list operation given the underlying query definition.

Parameters
session:SessionImplementor

The session owning this query.

queryParameters:QueryParameters

The query bind parameters.

Returns:List<E>

The query list results.

scrollback to summary
public ScrollableResults scroll(QueryParameters queryParameters, SessionImplementor session) throws HibernateException

Perform a scroll operation given the underlying query definition.

Parameters
queryParameters:QueryParameters

The query bind parameters.

session:SessionImplementor

The session owning this query.

Returns:ScrollableResults

The ScrollableResults wrapper around the query results.

validateScrollabilityback to summary
public void validateScrollability() throws HibernateException

Validate the scrollability of the translated query.