HHH-9286 - AbstractStandardBasicType implements ProcedureParameterNamedBinder

This commit is contained in:
Andrea Boriero 2016-01-20 16:33:01 +00:00
parent 2a43387081
commit 22dc33ff79
1 changed files with 16 additions and 1 deletions

View File

@ -32,7 +32,7 @@ import org.hibernate.type.descriptor.sql.SqlTypeDescriptor;
* @author Brett Meyer
*/
public abstract class AbstractStandardBasicType<T>
implements BasicType, StringRepresentableType<T>, ProcedureParameterExtractionAware<T> {
implements BasicType, StringRepresentableType<T>, ProcedureParameterExtractionAware<T>, ProcedureParameterNamedBinder {
private static final Size DEFAULT_SIZE = new Size( 19, 2, 255, Size.LobMultiplier.NONE ); // to match legacy behavior
private final Size dictatedSize = new Size();
@ -348,4 +348,19 @@ public abstract class AbstractStandardBasicType<T>
session.getWrapperOptions()
);
}
@Override
public void nullSafeSet(
CallableStatement st, Object value, String name, SessionImplementor session) throws SQLException {
nullSafeSet( st, value, name, session.getWrapperOptions() );
}
protected final void nullSafeSet(CallableStatement st, Object value, String name, WrapperOptions options) throws SQLException {
remapSqlTypeDescriptor( options ).getBinder( javaTypeDescriptor ).bind( st, ( T ) value, name, options );
}
@Override
public boolean canDoSetting() {
return true;
}
}