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 voidbind(CallableStatement st, J value, String name, WrapperOptions options) Bind a value to a callable statement by namefinal voidbind(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.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: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
- 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.
-