Package org.hibernate.sql.exec.internal
Class AbstractJdbcParameter
- java.lang.Object
-
- org.hibernate.sql.exec.internal.AbstractJdbcParameter
-
- All Implemented Interfaces:
Bindable,JdbcMappingContainer,MappingModelExpressible,SqlExpressible,SqlSelectionProducer,Expression,JdbcParameter,SqlAstNode,JdbcParameterBinder
- Direct Known Subclasses:
JdbcParameterImpl,SqlTypedMappingJdbcParameter,VersionTypeSeedParameterSpecification
public abstract class AbstractJdbcParameter extends Object implements JdbcParameter, JdbcParameterBinder, MappingModelExpressible, SqlExpressible
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.Bindable
Bindable.JdbcValuesConsumer
-
-
Field Summary
-
Fields inherited from interface org.hibernate.sql.exec.spi.JdbcParameterBinder
NOOP
-
-
Constructor Summary
Constructors Constructor Description AbstractJdbcParameter(JdbcMapping jdbcMapping)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(SqlAstWalker sqlTreeWalker)voidbindParameterValue(PreparedStatement statement, int startPosition, JdbcParameterBindings jdbcParamBindings, ExecutionContext executionContext)Bind the appropriate value in the JDBC statementprotected voidbindParameterValue(JdbcMapping jdbcMapping, PreparedStatement statement, Object bindValue, int startPosition, ExecutionContext executionContext)SqlSelectioncreateSqlSelection(int jdbcPosition, int valuesArrayPosition, JavaType javaType, TypeConfiguration typeConfiguration)Create a SqlSelection for the given JDBC ResultSet positionObjectdisassemble(Object value, SharedSessionContractImplementor session)intforEachDisassembledJdbcValue(Object value, Clause clause, int offset, Bindable.JdbcValuesConsumer valuesConsumer, SharedSessionContractImplementor session)intforEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action)Visit each JdbcMapping starting from the given offsetintforEachJdbcValue(Object value, Clause clause, int offset, Bindable.JdbcValuesConsumer valuesConsumer, SharedSessionContractImplementor session)MappingModelExpressiblegetExpressionType()The type for this expressionJdbcMappinggetJdbcMapping()Anything that is expressible at the SQL AST level would be of basic type.intgetJdbcTypeCount()The number of JDBC mappingsJdbcParameterBindergetParameterBinder()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.metamodel.mapping.Bindable
forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, getJdbcMappings
-
Methods inherited from interface org.hibernate.sql.ast.tree.expression.Expression
getColumnReference
-
-
-
-
Constructor Detail
-
AbstractJdbcParameter
public AbstractJdbcParameter(JdbcMapping jdbcMapping)
-
-
Method Detail
-
getParameterBinder
public JdbcParameterBinder getParameterBinder()
- Specified by:
getParameterBinderin interfaceJdbcParameter
-
getJdbcMapping
public JdbcMapping getJdbcMapping()
Description copied from interface:SqlExpressibleAnything that is expressible at the SQL AST level would be of basic type.- Specified by:
getJdbcMappingin interfaceSqlExpressible
-
accept
public void accept(SqlAstWalker sqlTreeWalker)
- Specified by:
acceptin interfaceSqlAstNode
-
createSqlSelection
public SqlSelection createSqlSelection(int jdbcPosition, int valuesArrayPosition, JavaType javaType, TypeConfiguration typeConfiguration)
Description copied from interface:SqlSelectionProducerCreate a SqlSelection for the given JDBC ResultSet position- Specified by:
createSqlSelectionin interfaceExpression- Specified by:
createSqlSelectionin interfaceSqlSelectionProducer- Parameters:
jdbcPosition- The index position used to read values from JDBCvaluesArrayPosition- The position in our "current JDBC values array"javaType- The descriptor for the Java type to read the value astypeConfiguration- The associated TypeConfiguration
-
bindParameterValue
public void bindParameterValue(PreparedStatement statement, int startPosition, JdbcParameterBindings jdbcParamBindings, ExecutionContext executionContext) throws SQLException
Description copied from interface:JdbcParameterBinderBind the appropriate value in the JDBC statement- Specified by:
bindParameterValuein interfaceJdbcParameterBinder- Throws:
SQLException
-
bindParameterValue
protected void bindParameterValue(JdbcMapping jdbcMapping, PreparedStatement statement, Object bindValue, int startPosition, ExecutionContext executionContext) throws SQLException
- Throws:
SQLException
-
getExpressionType
public MappingModelExpressible getExpressionType()
Description copied from interface:ExpressionThe type for this expression- Specified by:
getExpressionTypein interfaceExpression
-
getJdbcTypeCount
public int getJdbcTypeCount()
Description copied from interface:BindableThe number of JDBC mappings- Specified by:
getJdbcTypeCountin interfaceBindable- Specified by:
getJdbcTypeCountin interfaceJdbcMappingContainer
-
forEachJdbcType
public int forEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action)Description copied from interface:JdbcMappingContainerVisit each JdbcMapping starting from the given offset- Specified by:
forEachJdbcTypein interfaceJdbcMappingContainer
-
disassemble
public Object disassemble(Object value, SharedSessionContractImplementor session)
- Specified by:
disassemblein interfaceBindable- See Also:
As an example, consider the following domain model: ````
-
forEachDisassembledJdbcValue
public int forEachDisassembledJdbcValue(Object value, Clause clause, int offset, Bindable.JdbcValuesConsumer valuesConsumer, SharedSessionContractImplementor session)
- Specified by:
forEachDisassembledJdbcValuein interfaceBindable
-
forEachJdbcValue
public int forEachJdbcValue(Object value, Clause clause, int offset, Bindable.JdbcValuesConsumer valuesConsumer, SharedSessionContractImplementor session)
- Specified by:
forEachJdbcValuein interfaceBindable
-
-