org.hibernate.engine

Class ParameterBinder


public class ParameterBinder
extends java.lang.Object

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 Class Summary

static interface
ParameterBinder.NamedParameterSource

Method Summary

static int
bindNamedParameters(PreparedStatement ps, Map namedParams, int start, ParameterBinder.NamedParameterSource source, SessionImplementor session)
static int
bindNamedParameters(PreparedStatement ps, QueryParameters queryParameters, int start, ParameterBinder.NamedParameterSource source, SessionImplementor session)
static int
bindPositionalParameters(PreparedStatement st, Object[] values, Type[] types, int start, SessionImplementor session)
static int
bindPositionalParameters(PreparedStatement st, QueryParameters queryParameters, int start, SessionImplementor session)
static int
bindQueryParameters(PreparedStatement st, QueryParameters queryParameters, int start, ParameterBinder.NamedParameterSource source, SessionImplementor session)

Method Details

bindNamedParameters

public static int bindNamedParameters(PreparedStatement ps,
                                      Map namedParams,
                                      int start,
                                      ParameterBinder.NamedParameterSource source,
                                      SessionImplementor session)
            throws SQLException,
                   HibernateException

bindNamedParameters

public static int bindNamedParameters(PreparedStatement ps,
                                      QueryParameters queryParameters,
                                      int start,
                                      ParameterBinder.NamedParameterSource source,
                                      SessionImplementor session)
            throws SQLException,
                   HibernateException

bindPositionalParameters

public static int bindPositionalParameters(PreparedStatement st,
                                           Object[] values,
                                           Type[] types,
                                           int start,
                                           SessionImplementor session)
            throws SQLException,
                   HibernateException

bindPositionalParameters

public static int bindPositionalParameters(PreparedStatement st,
                                           QueryParameters queryParameters,
                                           int start,
                                           SessionImplementor session)
            throws SQLException,
                   HibernateException

bindQueryParameters

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