Class BasicBinder<J>
java.lang.Object
org.hibernate.type.descriptor.jdbc.BasicBinder<J>
- All Implemented Interfaces:
Serializable
,ValueBinder<J>
- Direct Known Subclasses:
SetObjectBinder
,XmlArrayJdbcType.XmlArrayBinder
,XmlJdbcType.XmlValueBinder
Convenience base implementation of
ValueBinder
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
bind
(CallableStatement st, J value, String name, WrapperOptions options) Bind a value to a callable statement by namefinal void
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.getBindValue
(J value, WrapperOptions options)
-
Constructor Details
-
BasicBinder
-
-
Method Details
-
getJavaType
-
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
- 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.
-