Class BasicBinder<J>
- java.lang.Object
-
- org.hibernate.type.descriptor.jdbc.BasicBinder<J>
-
- All Implemented Interfaces:
Serializable,ValueBinder<J>
- Direct Known Subclasses:
XmlJdbcType.XmlValueBinder
public abstract class BasicBinder<J> extends Object implements ValueBinder<J>, Serializable
Convenience base implementation ofValueBinder- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BasicBinder(JavaType<J> javaType, JdbcType jdbcType)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidbind(CallableStatement st, J value, String name, WrapperOptions options)Bind a value to a callable statement by namevoidbind(PreparedStatement st, J value, int index, WrapperOptions options)Bind a value to a prepared statement by indexprotected abstract voiddoBind(CallableStatement st, J value, String name, WrapperOptions options)Perform the binding.protected abstract voiddoBind(PreparedStatement st, J value, int index, WrapperOptions options)Perform the binding.protected voiddoBindNull(CallableStatement st, String name, WrapperOptions options)Perform the null binding.protected voiddoBindNull(PreparedStatement st, int index, WrapperOptions options)Perform the null binding.ObjectgetBindValue(J value, WrapperOptions options)JavaType<J>getJavaType()JdbcTypegetJdbcType()
-
-
-
Method Detail
-
getJdbcType
public JdbcType getJdbcType()
-
bind
public final void bind(PreparedStatement st, J value, int index, WrapperOptions options) throws SQLException
Description copied from interface:ValueBinderBind a value to a prepared statement by index- Specified by:
bindin interfaceValueBinder<J>- Throws:
SQLException- Indicates a JDBC error occurred.
-
bind
public final void bind(CallableStatement st, J value, String name, WrapperOptions options) throws SQLException
Description copied from interface:ValueBinderBind a value to a callable statement by name- Specified by:
bindin interfaceValueBinder<J>- Throws:
SQLException- Indicates a JDBC error occurred.
-
getBindValue
public Object getBindValue(J value, WrapperOptions options) throws SQLException
- Specified by:
getBindValuein interfaceValueBinder<J>- Throws:
SQLException
-
doBindNull
protected void doBindNull(PreparedStatement st, int index, WrapperOptions options) throws SQLException
Perform the null binding.- Parameters:
st- The prepared statementindex- The index at which to bindoptions- The binding options- Throws:
SQLException- Indicates a problem binding to the prepared statement.
-
doBindNull
protected void doBindNull(CallableStatement st, String name, WrapperOptions options) throws SQLException
Perform the null binding.- Parameters:
st- The CallableStatementname- The name at which to bindoptions- The binding options- Throws:
SQLException- Indicates a problem binding to the callable statement.
-
doBind
protected abstract void doBind(PreparedStatement st, J value, int index, WrapperOptions options) throws SQLException
Perform 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:
SQLException- Indicates a problem binding to the prepared statement.
-
doBind
protected abstract void doBind(CallableStatement st, J value, String name, WrapperOptions options) throws SQLException
Perform 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:
SQLException- Indicates a problem binding to the callable statement.
-
-