**java.lang.IllegalArgumentException: Bind value [false] was not of specified type [class org.hibernate.type.NumericBooleanType**
at org.hibernate.procedure.internal.ParameterBindImpl.internalSetValue(ParameterBindImpl.java:83)
at org.hibernate.procedure.internal.ParameterBindImpl.setBindValue(ParameterBindImpl.java:64)
at org.hibernate.procedure.internal.ProcedureCallImpl.setParameter(ProcedureCallImpl.java:818)
at org.hibernate.procedure.internal.ProcedureCallImpl.setParameter(ProcedureCallImpl.java:70)
This NumericBooleanType works in the previous Hibernate version 5.2.
What about the YesNoType? The result of it is the same exception.
How can I use my own implementations of UserType?
In my opinion, the backward compatibility is most important.
Please give me a solution, how can I use the YesNoType in a StoredProcedureQuery.
I have debugged the codes in hibernate-core. The implementation of ParameterRegistration was changed.
The implementations of ParameterRegistration in Hibenate 5.2:
NamedParameterRegistration:
@Override
@SuppressWarnings("unchecked")
public <T> ParameterRegistration<T> registerParameter(String name, Class<T> type, ParameterMode mode) {
final NamedParameterRegistration parameterRegistration = new NamedParameterRegistration( this, name, mode, type, globalParameterPassNullsSetting );
registerParameter( parameterRegistration );
return parameterRegistration;
}
PositionalParameterRegistration:
@Override
@SuppressWarnings("unchecked")
public <T> ParameterRegistration<T> registerParameter(int position, Class<T> type, ParameterMode mode) {
final PositionalParameterRegistration parameterRegistration =
new PositionalParameterRegistration( this, position, mode, type, globalParameterPassNullsSetting );
registerParameter( parameterRegistration );
return parameterRegistration;
}