Top Description Inners Fields Constructors Methods
org.hibernate.loader.custom.sql

public Class SQLCustomQuery

extends Object
implements CustomQuery
Class Inheritance
All Implemented Interfaces
org.hibernate.loader.custom.CustomQuery
Imports
java.util.ArrayList, .Collection, .HashSet, .List, .Map, .Set, .HashMap, org.hibernate.HibernateException, org.hibernate.engine.query.sql.NativeSQLQueryReturn, org.hibernate.engine.SessionFactoryImplementor, org.hibernate.loader.custom.CustomQuery, org.hibernate.persister.collection.SQLLoadableCollection, org.hibernate.persister.entity.SQLLoadable, org.slf4j.Logger, .LoggerFactory

Implements Hibernate's built-in support for native SQL queries.

This support is built on top of the notion of "custom queries"...

Authors
Gavin King, Max Andersen, Steve Ebersole

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final List<E>
public static final Logger
private final Map<K, V>
private final Set<E>
private final String

Constructor Summary

AccessConstructor and Description
public
SQLCustomQuery(final String sqlQuery, final NativeSQLQueryReturn[] queryReturns, final Collection<E> additionalQuerySpaces, final SessionFactoryImplementor factory)

Method Summary

Modifier and TypeMethod and Description
public List<E>
getCustomQueryReturns()

Implements org.hibernate.loader.custom.CustomQuery.getCustomQueryReturns.

A collection of descriptors describing the JDBC result set to be expected and how to map this result set.
public Map<K, V>
getNamedParameterBindPoints()

Implements org.hibernate.loader.custom.CustomQuery.getNamedParameterBindPoints.

A map representing positions within the supplied query to which we need to bind named parameters.
public Set<E>
getQuerySpaces()

Implements org.hibernate.loader.custom.CustomQuery.getQuerySpaces.

Any query spaces to apply to the query execution.
public String
getSQL()

Implements org.hibernate.loader.custom.CustomQuery.getSQL.

The SQL query string to be performed.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

customQueryReturnsback to summary
private final List<E> customQueryReturns
logback to summary
public static final Logger log
namedParameterBindPointsback to summary
private final Map<K, V> namedParameterBindPoints
querySpacesback to summary
private final Set<E> querySpaces
sqlback to summary
private final String sql

Constructor Detail

SQLCustomQueryback to summary
public SQLCustomQuery(final String sqlQuery, final NativeSQLQueryReturn[] queryReturns, final Collection<E> additionalQuerySpaces, final SessionFactoryImplementor factory) throws HibernateException

Method Detail

getCustomQueryReturnsback to summary
public List<E> getCustomQueryReturns()

Implements org.hibernate.loader.custom.CustomQuery.getCustomQueryReturns.

Doc from org.hibernate.loader.custom.CustomQuery.getCustomQueryReturns.

A collection of descriptors describing the JDBC result set to be expected and how to map this result set.

Returns:List<E>

List of return descriptors.

getNamedParameterBindPointsback to summary
public Map<K, V> getNamedParameterBindPoints()

Implements org.hibernate.loader.custom.CustomQuery.getNamedParameterBindPoints.

Doc from org.hibernate.loader.custom.CustomQuery.getNamedParameterBindPoints.

A map representing positions within the supplied query to which we need to bind named parameters.

Optional, may return null if no named parameters.

The structure of the returned map (if one) as follows:

  1. The keys into the map are the named parameter names
  2. The corresponding value is either an Integer if the parameter occurs only once in the query; or a List of Integers if the parameter occurs more than once
getQuerySpacesback to summary
public Set<E> getQuerySpaces()

Implements org.hibernate.loader.custom.CustomQuery.getQuerySpaces.

Doc from org.hibernate.loader.custom.CustomQuery.getQuerySpaces.

Any query spaces to apply to the query execution. Query spaces are used in Hibernate's auto-flushing mechanism to determine which entities need to be checked for pending changes.

Returns:Set<E>

The query spaces

getSQLback to summary
public String getSQL()

Implements org.hibernate.loader.custom.CustomQuery.getSQL.

Doc from org.hibernate.loader.custom.CustomQuery.getSQL.

The SQL query string to be performed.

Returns:String

The SQL statement string.

org.hibernate.loader.custom.sql back to summary

private Class SQLCustomQuery.ParserContext

extends Object
implements ParserContext
Class Inheritance
All Implemented Interfaces
org.hibernate.loader.custom.sql.SQLQueryParser.ParserContext

Field Summary

Modifier and TypeField and Description
private final SQLQueryReturnProcessor.ResultAliasContext

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public SQLLoadableCollection
public String
public SQLLoadable
public String
public Map<K, V>
public boolean
public boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

aliasContextback to summary
private final SQLQueryReturnProcessor.ResultAliasContext aliasContext

Constructor Detail

ParserContextback to summary
public ParserContext(SQLQueryReturnProcessor.ResultAliasContext aliasContext)

Method Detail

getCollectionPersisterByAliasback to summary
public SQLLoadableCollection getCollectionPersisterByAlias(String alias)

Implements org.hibernate.loader.custom.sql.SQLQueryParser.ParserContext.getCollectionPersisterByAlias.

getCollectionSuffixByAliasback to summary
public String getCollectionSuffixByAlias(String alias)

Implements org.hibernate.loader.custom.sql.SQLQueryParser.ParserContext.getCollectionSuffixByAlias.

getEntityPersisterByAliasback to summary
public SQLLoadable getEntityPersisterByAlias(String alias)

Implements org.hibernate.loader.custom.sql.SQLQueryParser.ParserContext.getEntityPersisterByAlias.

getEntitySuffixByAliasback to summary
public String getEntitySuffixByAlias(String alias)

Implements org.hibernate.loader.custom.sql.SQLQueryParser.ParserContext.getEntitySuffixByAlias.

getPropertyResultsMapByAliasback to summary
public Map<K, V> getPropertyResultsMapByAlias(String alias)

Implements org.hibernate.loader.custom.sql.SQLQueryParser.ParserContext.getPropertyResultsMapByAlias.

isCollectionAliasback to summary
public boolean isCollectionAlias(String alias)

Implements org.hibernate.loader.custom.sql.SQLQueryParser.ParserContext.isCollectionAlias.

isEntityAliasback to summary
public boolean isEntityAlias(String alias)

Implements org.hibernate.loader.custom.sql.SQLQueryParser.ParserContext.isEntityAlias.