Class BasicBinder<J>
- java.lang.Object
-
- org.hibernate.type.descriptor.jdbc.BasicBinder<J>
-
- All Implemented Interfaces:
Serializable
,ValueBinder<J>
- Direct Known Subclasses:
SetObjectBinder
,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 void
bind(CallableStatement st, J value, String name, WrapperOptions options)
Bind a value to a callable statement by namevoid
bind(PreparedStatement st, J value, int index, WrapperOptions options)
Bind a value to a prepared statement by indexprotected abstract void
doBind(CallableStatement st, J value, String name, WrapperOptions options)
Perform the binding.protected abstract void
doBind(PreparedStatement st, J value, int index, WrapperOptions options)
Perform the binding.protected void
doBindNull(CallableStatement st, String name, WrapperOptions options)
Perform the null binding.protected void
doBindNull(PreparedStatement st, int index, WrapperOptions options)
Perform the null binding.Object
getBindValue(J value, WrapperOptions options)
JavaType<J>
getJavaType()
JdbcType
getJdbcType()
-
-
-
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:ValueBinder
Bind a value to a prepared statement by index- Specified by:
bind
in 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:ValueBinder
Bind a value to a callable statement by name- Specified by:
bind
in interfaceValueBinder<J>
- Throws:
SQLException
- Indicates a JDBC error occurred.
-
getBindValue
public Object getBindValue(J value, WrapperOptions options) throws SQLException
- Specified by:
getBindValue
in 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.
-
-