public interface

QueryTranslator

org.hibernate.hql.QueryTranslator
Known Indirect Subclasses

Class Overview

Defines the contract of an HQL->SQL translator.

Summary

Constants
String ERROR_CANNOT_DETERMINE_TYPE
String ERROR_CANNOT_FETCH_WITH_ITERATE
String ERROR_CANNOT_FORMAT_LITERAL
String ERROR_NAMED_PARAMETER_DOES_NOT_APPEAR
Public Methods
abstract List collectSqlStrings()
abstract void compile(Map replacements, boolean shallow)
Compile a "normal" query.
abstract boolean containsCollectionFetches()
Does the translated query contain collection fetches?
abstract int executeUpdate(QueryParameters queryParameters, SessionImplementor session)
Perform a bulk update/delete operation given the underlying query definition.
abstract String[][] getColumnNames()
Returns the column names in the generated SQL.
abstract Map getEnabledFilters()
Returns the filters enabled for this query translator.
abstract ParameterTranslations getParameterTranslations()
Return information about any parameters encountered during translation.
abstract String getQueryIdentifier()
Retrieve the query identifier for this translator.
abstract Set getQuerySpaces()
Returns the set of query spaces (table names) that the query refers to.
abstract String getQueryString()
Returns the HQL string processed by the translator.
abstract String[] getReturnAliases()
Returns an array of HQL aliases
abstract Type[] getReturnTypes()
Returns an array of Types represented in the query result.
abstract String getSQLString()
Returns the SQL string generated by the translator.
abstract boolean isManipulationStatement()
abstract Iterator iterate(QueryParameters queryParameters, EventSource session)
Perform an iterate operation given the underlying query definition.
abstract List list(SessionImplementor session, QueryParameters queryParameters)
Perform a list operation given the underlying query definition.
abstract ScrollableResults scroll(QueryParameters queryParameters, SessionImplementor session)
Perform a scroll operation given the underlying query definition.
abstract void validateScrollability()
Validate the scrollability of the translated query.

Constants

public static final String ERROR_CANNOT_DETERMINE_TYPE

Constant Value: "Could not determine type of: "

public static final String ERROR_CANNOT_FETCH_WITH_ITERATE

Constant Value: "fetch may not be used with scroll() or iterate()"

public static final String ERROR_CANNOT_FORMAT_LITERAL

Constant Value: "Could not format constant value to SQL literal: "

public static final String ERROR_NAMED_PARAMETER_DOES_NOT_APPEAR

Constant Value: "Named parameter does not appear in Query: "

Public Methods

public abstract List collectSqlStrings ()

public abstract void compile (Map replacements, boolean shallow)

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

Parameters
replacements Defined query substitutions.
shallow Does this represent a shallow (scalar or entity-id) select?
Throws
QueryException There was a problem parsing the query string.
MappingException There was a problem querying defined mappings.

public abstract boolean containsCollectionFetches ()

Does the translated query contain collection fetches?

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

public abstract int executeUpdate (QueryParameters queryParameters, SessionImplementor session)

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

Parameters
queryParameters The query bind parameters.
session The session owning this query.
Returns
  • The number of entities updated or deleted.

public abstract String[][] getColumnNames ()

Returns the column names in the generated SQL.

Returns
  • the column names in the generated SQL.

public abstract Map getEnabledFilters ()

Returns the filters enabled for this query translator.

Returns
  • Filters enabled for this query execution.

public abstract ParameterTranslations getParameterTranslations ()

Return information about any parameters encountered during translation.

Returns
  • The parameter information.

public abstract String getQueryIdentifier ()

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

Returns
  • the identifier

public abstract Set getQuerySpaces ()

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

Returns
  • A set of query spaces (table names).

public abstract String getQueryString ()

Returns the HQL string processed by the translator.

Returns
  • the HQL string processed by the translator.

public abstract String[] getReturnAliases ()

Returns an array of HQL aliases

public abstract Type[] getReturnTypes ()

Returns an array of Types represented in the query result.

Returns
  • Query return types.

public abstract String getSQLString ()

Returns the SQL string generated by the translator.

Returns
  • the SQL string generated by the translator.

public abstract boolean isManipulationStatement ()

public abstract Iterator iterate (QueryParameters queryParameters, EventSource session)

Perform an iterate operation given the underlying query definition.

Parameters
queryParameters The query bind parameters.
session The session owning this query.
Returns
  • An iterator over the query results.

public abstract List list (SessionImplementor session, QueryParameters queryParameters)

Perform a list operation given the underlying query definition.

Parameters
session The session owning this query.
queryParameters The query bind parameters.
Returns
  • The query list results.

public abstract ScrollableResults scroll (QueryParameters queryParameters, SessionImplementor session)

Perform a scroll operation given the underlying query definition.

Parameters
queryParameters The query bind parameters.
session The session owning this query.
Returns
  • The ScrollableResults wrapper around the query results.

public abstract void validateScrollability ()

Validate the scrollability of the translated query.