With criteria builder, I’m calling a function which has a collection as parameter. This fails with a NullPointerException when hibernate validates the types. My code (simplified), where I define a generic “contains in array” check.
This fails at ArgumentTypesValidator.validate:92 with a NullPointerException: final JdbcType jdbcType = getJdbcType( queryEngine, argument, indicators, javaType ); // → null jdbcType.getDefaultSqlTypeCode() → NullPointerException The ArgumentTypesValidator.getJdbcType:139 calls javaType.getRecommendedJdbcType and CollectionJavaType.getRecommendedJdbcType always returns null. I think that ArgumentTypesValidator.validate should handle a null jdbcType properly, in that case not doing the validation. Or what is your opinion? Is there a workaround? |