Top Description Inners Fields Constructors Methods
org.hibernate.engine.internal

public Class ParameterBinder

extends Object
Class Inheritance
Imports
java.sql.PreparedStatement, .SQLException, java.util.Iterator, .Map, org.hibernate.HibernateException, org.hibernate.engine.spi.QueryParameters, .SessionImplementor, .TypedValue, org.hibernate.internal.CoreMessageLogger, org.hibernate.type.Type, org.jboss.logging.Logger

Centralizes the commonality regarding binding of parameter values into PreparedStatements as this logic is used in many places.

Ideally would like to move to the parameter handling as it is done in the hql.ast package.

Author
Steve Ebersole

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
ParameterBinder.NamedParameterSource

Helper contract for dealing with named parameters and resolving their locations

Field Summary

Modifier and TypeField and Description
private static final CoreMessageLogger

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static int
bindNamedParameters(final PreparedStatement ps, final QueryParameters queryParameters, final int start, final ParameterBinder.NamedParameterSource source, final SessionImplementor session)

Deprecated as a consequence of SessionImplementor being deprecated.
private static int
bindNamedParameters(final PreparedStatement ps, final Map<K, V> namedParams, final int start, final ParameterBinder.NamedParameterSource source, final SessionImplementor session)

Deprecated as a consequence of SessionImplementor being deprecated.
private static int
bindPositionalParameters(final PreparedStatement st, final QueryParameters queryParameters, final int start, final SessionImplementor session)

Deprecated as a consequence of SessionImplementor being deprecated.
private static int
bindPositionalParameters(final PreparedStatement st, final Object[] values, final Type[] types, final int start, final SessionImplementor session)

Deprecated as a consequence of SessionImplementor being deprecated.
public static int

Returns:

The next bind position after the last position we bound here.
bindQueryParameters
(final PreparedStatement
The statement to bind parameters to
st
,
final QueryParameters
The parameters
queryParameters
,
final int
The initial bind position
start
,
final ParameterBinder.NamedParameterSource
The named parameter source, for resolving the locations of named parameters
source
,
SessionImplementor
The session
session
)

Deprecated as a consequence of SessionImplementor being deprecated.
Perform parameter binding
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

LOGback to summary
private static final CoreMessageLogger LOG

Constructor Detail

ParameterBinderback to summary
private ParameterBinder()

Method Detail

bindNamedParametersback to summary
private static int bindNamedParameters(final PreparedStatement ps, final QueryParameters queryParameters, final int start, final ParameterBinder.NamedParameterSource source, final SessionImplementor session) throws SQLException, HibernateException

Deprecated

as a consequence of SessionImplementor being deprecated. See corresponding docs for further information.

bindNamedParametersback to summary
private static int bindNamedParameters(final PreparedStatement ps, final Map<K, V> namedParams, final int start, final ParameterBinder.NamedParameterSource source, final SessionImplementor session) throws SQLException, HibernateException

Deprecated

as a consequence of SessionImplementor being deprecated. See corresponding docs for further information.

bindPositionalParametersback to summary
private static int bindPositionalParameters(final PreparedStatement st, final QueryParameters queryParameters, final int start, final SessionImplementor session) throws SQLException, HibernateException

Deprecated

as a consequence of SessionImplementor being deprecated. See corresponding docs for further information.

bindPositionalParametersback to summary
private static int bindPositionalParameters(final PreparedStatement st, final Object[] values, final Type[] types, final int start, final SessionImplementor session) throws SQLException, HibernateException

Deprecated

as a consequence of SessionImplementor being deprecated. See corresponding docs for further information.

bindQueryParametersback to summary
public static int bindQueryParameters(final PreparedStatement st, final QueryParameters queryParameters, final int start, final ParameterBinder.NamedParameterSource source, SessionImplementor session) throws SQLException, HibernateException

Deprecated

as a consequence of SessionImplementor being deprecated. See corresponding docs for further information.

Perform parameter binding

Parameters
st:PreparedStatement

The statement to bind parameters to

queryParameters:QueryParameters

The parameters

start:int

The initial bind position

source:ParameterBinder.NamedParameterSource

The named parameter source, for resolving the locations of named parameters

session:SessionImplementor

The session

Returns:int

The next bind position after the last position we bound here.

Exceptions
SQLException:
Indicates a problem calling JDBC bind methods
HibernateException:
Indicates a problem access bind values.
org.hibernate.engine.internal back to summary

public Interface ParameterBinder.NamedParameterSource

Known Direct Implementers
org.hibernate.hql.internal.ast.HqlSqlWalker

Helper contract for dealing with named parameters and resolving their locations

Method Summary

Modifier and TypeMethod and Description
public int[]

Returns:

The locations
getNamedParameterLocations
(String
The parameter name
name
)

Retrieve the locations for the given parameter name

Method Detail

getNamedParameterLocationsback to summary
public int[] getNamedParameterLocations(String name)

Retrieve the locations for the given parameter name

Parameters
name:String

The parameter name

Returns:int[]

The locations