Top Fields Constructors Methods
org.hibernate.query.procedure.internal

public Class ProcedureParameterImpl<T>

extends QueryParameterImpl<T>
implements ProcedureParameterImplementor<T>, ParameterRegistration<T>
Class Inheritance
All Implemented Interfaces
org.hibernate.procedure.ParameterRegistration, org.hibernate.query.procedure.ProcedureParameter, org.hibernate.query.QueryParameter, javax.persistence.Parameter, org.hibernate.query.procedure.spi.ProcedureParameterImplementor, org.hibernate.procedure.spi.ParameterRegistrationImplementor
Imports
java.sql.CallableStatement, .SQLException, .Types, java.util.Calendar, javax.persistence.ParameterMode, .TemporalType, org.hibernate.engine.jdbc.cursor.spi.RefCursorSupport, org.hibernate.engine.jdbc.env.spi.ExtractedDatabaseMetaData, .JdbcEnvironment, org.hibernate.procedure.ParameterBind, .ParameterMisuseException, .ParameterRegistration, org.hibernate.procedure.internal.ProcedureCallImpl, org.hibernate.procedure.spi.ParameterStrategy, org.hibernate.query.internal.QueryParameterImpl, org.hibernate.query.procedure.spi.ProcedureParameterImplementor, org.hibernate.type.CalendarDateType, .CalendarTimeType, .CalendarType, .ProcedureParameterExtractionAware, .ProcedureParameterNamedBinder, .Type, org.jboss.logging.Logger

Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private final Class<T>
private static final Logger
private final ParameterMode
private final String
private boolean
private final Integer
private final ProcedureCallImpl<R>
procedureCall

Deprecated as a consequence of ProcedureCallImpl being deprecated.
private int[]
private int

Constructor Summary

AccessConstructor and Description
public
ProcedureParameterImpl(ProcedureCallImpl<R> procedureCall, String name, ParameterMode mode, Class<T> javaType, Type hibernateType, boolean initialPassNullsSetting)

Deprecated as a consequence of ProcedureCallImpl being deprecated.
public
ProcedureParameterImpl(ProcedureCallImpl<R> procedureCall, Integer position, ParameterMode mode, Class<T> javaType, Type hibernateType, boolean initialPassNullsSetting)

Deprecated as a consequence of ProcedureCallImpl being deprecated.

Method Summary

Modifier and TypeMethod and Description
public void
bindValue(Object
The value to bind.
value
)

Implements org.hibernate.procedure.ParameterRegistration.bindValue.

Bind a value to the parameter.
public void
bindValue(Object
The value to bind
value
,
TemporalType
An explicitly supplied TemporalType.
explicitTemporalType
)

Implements org.hibernate.procedure.ParameterRegistration.bindValue.

Bind a value to the parameter, using just a specified portion of the DATE/TIME value.
private boolean
private Type
public void
enablePassingNulls(boolean
true indicates that the NULL should be passed; false indicates it should not.
enabled
)

Implements org.hibernate.query.procedure.ProcedureParameter.enablePassingNulls, org.hibernate.procedure.ParameterRegistration.enablePassingNulls.

Controls how unbound values for this IN/INOUT parameter registration will be handled prior to execution.
public T
extract(CallableStatement
The callable statement
statement
)

Implements org.hibernate.procedure.spi.ParameterRegistrationImplementor.extract.

Extract value from the statement after execution (used for OUT/INOUT parameters).
public ParameterBind<T>
getBind()

Implements org.hibernate.procedure.ParameterRegistration.getBind.

Retrieve the binding associated with this parameter.
public ParameterMode
getMode()

Implements org.hibernate.query.procedure.ProcedureParameter.getMode, org.hibernate.procedure.ParameterRegistration.getMode.

Retrieves the parameter "mode" which describes how the parameter is defined in the actual database procedure definition (is it an INPUT parameter?
public String
getName()

Implements javax.persistence.Parameter.getName, org.hibernate.procedure.ParameterRegistration.getName.

The name under which this parameter was registered.
public Class<T>
public Integer
public int[]
public int[]
getSqlTypes()

Implements org.hibernate.procedure.spi.ParameterRegistrationImplementor.getSqlTypes.

Access to the SQL type(s) for this parameter
public boolean
public void
prepare(CallableStatement
The statement about to be executed
statement
,
int
The parameter index for this registration (used for positional)
startIndex
)

Implements org.hibernate.procedure.spi.ParameterRegistrationImplementor.prepare.

Prepare for execution.
public void
setHibernateType(Type
The Hibernate mapping type.
expectedType
)

Overrides org.hibernate.query.internal.QueryParameterImpl.setHibernateType.

Implements org.hibernate.procedure.ParameterRegistration.setHibernateType.

Set the Hibernate mapping type for this parameter.
Inherited from org.hibernate.query.internal.QueryParameterImpl:
getHibernateType

Field Detail

javaTypeback to summary
private final Class<T> javaType
logback to summary
private static final Logger log
modeback to summary
private final ParameterMode mode
nameback to summary
private final String name
passNullsEnabledback to summary
private boolean passNullsEnabled
positionback to summary
private final Integer position
procedureCallback to summary
private final ProcedureCallImpl<R> procedureCall

Deprecated

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

sqlTypesback to summary
private int[] sqlTypes
startIndexback to summary
private int startIndex

Constructor Detail

ProcedureParameterImplback to summary
public ProcedureParameterImpl(ProcedureCallImpl<R> procedureCall, String name, ParameterMode mode, Class<T> javaType, Type hibernateType, boolean initialPassNullsSetting)

Deprecated

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

ProcedureParameterImplback to summary
public ProcedureParameterImpl(ProcedureCallImpl<R> procedureCall, Integer position, ParameterMode mode, Class<T> javaType, Type hibernateType, boolean initialPassNullsSetting)

Deprecated

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

Method Detail

bindValueback to summary
public void bindValue(Object value)

Implements org.hibernate.procedure.ParameterRegistration.bindValue.

Doc from org.hibernate.procedure.ParameterRegistration.bindValue.

Bind a value to the parameter. How this value is bound to the underlying JDBC CallableStatement is totally dependent on the Hibernate type.

Parameters
value:Object

The value to bind.

Annotations
@Override
@SuppressWarnings:unchecked
bindValueback to summary
public void bindValue(Object value, TemporalType explicitTemporalType)

Implements org.hibernate.procedure.ParameterRegistration.bindValue.

Doc from org.hibernate.procedure.ParameterRegistration.bindValue.

Bind a value to the parameter, using just a specified portion of the DATE/TIME value. It is illegal to call this form if the parameter is not DATE/TIME type. The Hibernate type is circumvented in this case and an appropriate "precision" Type is used instead.

Parameters
value:Object

The value to bind

explicitTemporalType:TemporalType

An explicitly supplied TemporalType.

Annotations
@Override
@SuppressWarnings:unchecked
canDoNameParameterBindingback to summary
private boolean canDoNameParameterBinding(Type hibernateType)
determineHibernateTypeback to summary
private Type determineHibernateType()
enablePassingNullsback to summary
public void enablePassingNulls(boolean enabled)

Implements org.hibernate.query.procedure.ProcedureParameter.enablePassingNulls, org.hibernate.procedure.ParameterRegistration.enablePassingNulls.

Doc from org.hibernate.procedure.ParameterRegistration.enablePassingNulls.

Controls how unbound values for this IN/INOUT parameter registration will be handled prior to execution. There are 2 possible options to handle it:

  • bind the NULL to the parameter
  • do not bind the NULL to the parameter

The reason for the distinction comes from default values defined on the corresponding database procedure/function argument. Any time a value (including NULL) is bound to the argument, its default value will not be used. So effectively this setting controls whether the NULL should be interpreted as "pass the NULL" or as "apply the argument default".

The (global) default this setting is defined by org.hibernate.cfg.AvailableSettings#PROCEDURE_NULL_PARAM_PASSING

Parameters
enabled:boolean

true indicates that the NULL should be passed; false indicates it should not.

Annotations
@Override
extractback to summary
public T extract(CallableStatement statement)

Implements org.hibernate.procedure.spi.ParameterRegistrationImplementor.extract.

Doc from org.hibernate.procedure.spi.ParameterRegistrationImplementor.extract.

Extract value from the statement after execution (used for OUT/INOUT parameters).

Parameters
statement:CallableStatement

The callable statement

Returns:T

The extracted value

Annotations
@Override
@SuppressWarnings:unchecked
getBindback to summary
public ParameterBind<T> getBind()

Implements org.hibernate.procedure.ParameterRegistration.getBind.

Doc from org.hibernate.procedure.ParameterRegistration.getBind.

Retrieve the binding associated with this parameter. The binding is only relevant for INPUT parameters. Can return null if nothing has been bound yet. To bind a value to the parameter use one of the bindValue methods.

Returns:ParameterBind<T>

The parameter binding

Annotations
@Override
getModeback to summary
public ParameterMode getMode()

Implements org.hibernate.query.procedure.ProcedureParameter.getMode, org.hibernate.procedure.ParameterRegistration.getMode.

Doc from org.hibernate.procedure.ParameterRegistration.getMode.

Retrieves the parameter "mode" which describes how the parameter is defined in the actual database procedure definition (is it an INPUT parameter? An OUTPUT parameter? etc).

Returns:ParameterMode

The parameter mode.

Annotations
@Override
getNameback to summary
public String getName()

Implements javax.persistence.Parameter.getName, org.hibernate.procedure.ParameterRegistration.getName.

Doc from org.hibernate.procedure.ParameterRegistration.getName.

The name under which this parameter was registered. Can be null which should indicate that positional registration was used (and therefore getPosition() should return non-null.

Returns:String

The name;

Annotations
@Override
getParameterTypeback to summary
public Class<T> getParameterType()

Overrides org.hibernate.query.internal.QueryParameterImpl.getParameterType.

Implements javax.persistence.Parameter.getParameterType.

Doc from javax.persistence.Parameter.getParameterType.

Return the Java type of the parameter. Values bound to the parameter must be assignable to this type. This method is required to be supported for criteria queries only. Applications that use this method for Java Persistence query language queries and native queries will not be portable.

Returns:Class<T>

the Java type of the parameter

Annotations
@Override
getPositionback to summary
public Integer getPosition()

Implements javax.persistence.Parameter.getPosition, org.hibernate.procedure.ParameterRegistration.getPosition.

Doc from org.hibernate.procedure.ParameterRegistration.getPosition.

The position at which this parameter was registered. Can be null which should indicate that named registration was used (and therefore getName() should return non-null).

Returns:Integer

The name;

Annotations
@Override
getSourceLocationsback to summary
public int[] getSourceLocations()

Implements org.hibernate.query.QueryParameter.getSourceLocations.

Annotations
@Override
getSqlTypesback to summary
public int[] getSqlTypes()

Implements org.hibernate.procedure.spi.ParameterRegistrationImplementor.getSqlTypes.

Doc from org.hibernate.procedure.spi.ParameterRegistrationImplementor.getSqlTypes.

Access to the SQL type(s) for this parameter

Returns:int[]

The SQL types (JDBC type codes)

Annotations
@Override
isPassNullsEnabledback to summary
public boolean isPassNullsEnabled()

Implements org.hibernate.query.procedure.ProcedureParameter.isPassNullsEnabled, org.hibernate.procedure.spi.ParameterRegistrationImplementor.isPassNullsEnabled.

Doc from org.hibernate.query.procedure.ProcedureParameter.isPassNullsEnabled.

How will an unbound value be handled in terms of the JDBC parameter?

Returns:boolean

true here indicates that NULL should be passed; false indicates that it is ignored.

Annotations
@Override
prepareback to summary
public void prepare(CallableStatement statement, int startIndex) throws SQLException

Implements org.hibernate.procedure.spi.ParameterRegistrationImplementor.prepare.

Doc from org.hibernate.procedure.spi.ParameterRegistrationImplementor.prepare.

Prepare for execution.

Parameters
statement:CallableStatement

The statement about to be executed

startIndex:int

The parameter index for this registration (used for positional)

Annotations
@Override
Exceptions
SQLException:
Indicates a problem accessing the statement object
setHibernateTypeback to summary
public void setHibernateType(Type expectedType)

Overrides org.hibernate.query.internal.QueryParameterImpl.setHibernateType.

Implements org.hibernate.procedure.ParameterRegistration.setHibernateType.

Doc from org.hibernate.procedure.ParameterRegistration.setHibernateType.

Set the Hibernate mapping type for this parameter.

Parameters
expectedType:Type

The Hibernate mapping type.

Annotations
@Override