Top Description Fields Constructors Methods
org.hibernate.engine.query

public Class NativeSQLQueryPlan

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.io.Serializable, java.sql.PreparedStatement, .SQLException, java.util.Iterator, .List, .Map, org.slf4j.Logger, .LoggerFactory, org.hibernate.HibernateException, .QueryException, org.hibernate.engine.query.sql.NativeSQLQuerySpecification, org.hibernate.action.BulkOperationCleanupAction, org.hibernate.engine.QueryParameters, .SessionFactoryImplementor, .SessionImplementor, .TypedValue, org.hibernate.event.EventSource, org.hibernate.exception.JDBCExceptionHelper, org.hibernate.loader.custom.sql.SQLCustomQuery, org.hibernate.type.Type, org.hibernate.util.ArrayHelper

Defines a query execution plan for a native-SQL query.
Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private final SQLCustomQuery
private static final Logger
private final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private int

Returns:

The number of JDBC bind positions accounted for during execution.
bindNamedParameters
(final PreparedStatement
The prepared statement to which to bind the parameter values.
ps
,
final Map<K, V>
The named query parameters specified by the application.
namedParams
,
final int
JDBC paramer binds are positional, so this is the position from which to start binding.
start
,
final SessionImplementor
The session from which the query originated.
session
)

Perform binding of all the JDBC bind parameter values based on the user-defined named query parameters into the JDBC PreparedStatement.

private int

Returns:

The number of JDBC bind positions accounted for during execution.
bindPositionalParameters
(final PreparedStatement
The prepared statement to which to bind the parameter values.
st
,
final QueryParameters
The query parameters specified by the application.
queryParameters
,
final int
JDBC paramer binds are positional, so this is the position from which to start binding.
start
,
final SessionImplementor
The session from which the query originated.
session
)

Perform binding of all the JDBC bind parameter values based on the user-defined positional query parameters (these are the '?'-style hibernate query params) into the JDBC PreparedStatement.

protected void
public SQLCustomQuery
private int[]
public String
public int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

customQueryback to summary
private final SQLCustomQuery customQuery
logback to summary
private static final Logger log
sourceQueryback to summary
private final String sourceQuery

Constructor Detail

NativeSQLQueryPlanback to summary
public NativeSQLQueryPlan(NativeSQLQuerySpecification specification, SessionFactoryImplementor factory)

Method Detail

bindNamedParametersback to summary
private int bindNamedParameters(final PreparedStatement ps, final Map<K, V> namedParams, final int start, final SessionImplementor session) throws SQLException

Perform binding of all the JDBC bind parameter values based on the user-defined named query parameters into the JDBC PreparedStatement.

Parameters
ps:PreparedStatement

The prepared statement to which to bind the parameter values.

namedParams:Map<K, V>

The named query parameters specified by the application.

start:int

JDBC paramer binds are positional, so this is the position from which to start binding.

session:SessionImplementor

The session from which the query originated.

Returns:int

The number of JDBC bind positions accounted for during execution.

Exceptions
SQLException:
Some form of JDBC error binding the values.
HibernateException:
Generally indicates a mapping problem or type mismatch.
bindPositionalParametersback to summary
private int bindPositionalParameters(final PreparedStatement st, final QueryParameters queryParameters, final int start, final SessionImplementor session) throws SQLException

Perform binding of all the JDBC bind parameter values based on the user-defined positional query parameters (these are the '?'-style hibernate query params) into the JDBC PreparedStatement.

Parameters
st:PreparedStatement

The prepared statement to which to bind the parameter values.

queryParameters:QueryParameters

The query parameters specified by the application.

start:int

JDBC paramer binds are positional, so this is the position from which to start binding.

session:SessionImplementor

The session from which the query originated.

Returns:int

The number of JDBC bind positions accounted for during execution.

Exceptions
SQLException:
Some form of JDBC error binding the values.
HibernateException:
Generally indicates a mapping problem or type mismatch.
coordinateSharedCacheCleanupback to summary
protected void coordinateSharedCacheCleanup(SessionImplementor session)
getCustomQueryback to summary
public SQLCustomQuery getCustomQuery()
getNamedParameterLocsback to summary
private int[] getNamedParameterLocs(String name) throws QueryException
getSourceQueryback to summary
public String getSourceQuery()
performExecuteUpdateback to summary
public int performExecuteUpdate(QueryParameters queryParameters, SessionImplementor session) throws HibernateException