Class BasicBinder<J>
- java.lang.Object
-
- org.hibernate.type.descriptor.sql.BasicBinder<J>
-
- All Implemented Interfaces:
ValueBinder<J>
public abstract class BasicBinder<J> extends java.lang.Object implements ValueBinder<J>
Convenience base implementation ofValueBinder
-
-
Constructor Summary
Constructors Constructor Description BasicBinder(JavaTypeDescriptor<J> javaDescriptor, SqlTypeDescriptor sqlDescriptor)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidbind(java.sql.CallableStatement st, J value, java.lang.String name, WrapperOptions options)Bind a value to a CallableStatement.voidbind(java.sql.PreparedStatement st, J value, int index, WrapperOptions options)Bind a value to a prepared statement.protected abstract voiddoBind(java.sql.CallableStatement st, J value, java.lang.String name, WrapperOptions options)Perform the binding.protected abstract voiddoBind(java.sql.PreparedStatement st, J value, int index, WrapperOptions options)Perform the binding.JavaTypeDescriptor<J>getJavaDescriptor()SqlTypeDescriptorgetSqlDescriptor()
-
-
-
Constructor Detail
-
BasicBinder
public BasicBinder(JavaTypeDescriptor<J> javaDescriptor, SqlTypeDescriptor sqlDescriptor)
-
-
Method Detail
-
getJavaDescriptor
public JavaTypeDescriptor<J> getJavaDescriptor()
-
getSqlDescriptor
public SqlTypeDescriptor getSqlDescriptor()
-
bind
public final void bind(java.sql.PreparedStatement st, J value, int index, WrapperOptions options) throws java.sql.SQLExceptionDescription copied from interface:ValueBinderBind a value to a prepared statement.- Specified by:
bindin interfaceValueBinder<J>- Parameters:
st- The prepared statement to which to bind the value.value- The value to bind.index- The position at which to bind the value within the prepared statementoptions- The options.- Throws:
java.sql.SQLException- Indicates a JDBC error occurred.
-
bind
public final void bind(java.sql.CallableStatement st, J value, java.lang.String name, WrapperOptions options) throws java.sql.SQLExceptionDescription copied from interface:ValueBinderBind a value to a CallableStatement.- Specified by:
bindin interfaceValueBinder<J>- Parameters:
st- The prepared statement to which to bind the value.value- The value to bind.name- The name to bind the value within the prepared statementoptions- The options.- Throws:
java.sql.SQLException- Indicates a JDBC error occurred.
-
doBind
protected abstract void doBind(java.sql.PreparedStatement st, J value, int index, WrapperOptions options) throws java.sql.SQLExceptionPerform the binding. Safe to assume that value is not null.- Parameters:
st- The prepared statementvalue- The value to bind (not null).index- The index at which to bindoptions- The binding options- Throws:
java.sql.SQLException- Indicates a problem binding to the prepared statement.
-
doBind
protected abstract void doBind(java.sql.CallableStatement st, J value, java.lang.String name, WrapperOptions options) throws java.sql.SQLExceptionPerform the binding. Safe to assume that value is not null.- Parameters:
st- The CallableStatementvalue- The value to bind (not null).name- The name at which to bindoptions- The binding options- Throws:
java.sql.SQLException- Indicates a problem binding to the prepared statement.
-
-