| We are using the Hibernate Generator to generate our entity classes based on existing data structures. To map the types we rely on UserType (they are supported by the generator and JPA AttributeConverter were not yet available when we started the project years ago). To let the generator create a primitive boolean property (e. g. for a not-null column) in the entity, the returnedClass of the UserType has to be boolean.class. This however seems to confuse the QueryParameterBindingValidator introduced for
HHH-11397 Closed in 5.2.9 - it worked like a charm until 5.2.8.
java.lang.IllegalArgumentException: Parameter value [true] did not match expected type [boolean (n/a)]
at org.hibernate.query.spi.QueryParameterBindingValidator.validate(QueryParameterBindingValidator.java:54)
Note: The same applies to other primitive types as well! Please find a stripped down test case here: https://github.com/abenneke/sandbox/tree/master/hibernate-primitive-parameter |