Count query with TYPE fails on the second run with @Query and QueryDSL in spring-data-jpa 3.0.0-M5 and hibernate 6.1.2 #2629
Labels
for: external-project
For an external project and not something we can fix
status: duplicate
A duplicate of another issue
Count query with TYPE fails on the second run with QueryDSL and
@Query
when specifying a parameter.Spring data JPA version: 3.0.0-M5
Fails with Hibernate version: 6.1.2.Final or 6.1.3.Final.
Works with Hibernate version 6.1.1.Final
As you can see from the log below the same query is generated by querydsl. And fails on the second run with java.lang.AssertionError.
Please see the attached reproducer:
demo.zip
Did some debugging and found that on the first pass the discriminator value is a String
DOG
and on the second pass it is the classcom.example.demo.Dog
inorg.hibernate.sql.exec.internal.JdbcParameterBindingImpl
. Since the type is expected to be a String the type assertion fails atassert bindValue == null || jdbcMapping.getJdbcJavaType().isInstance( bindValue );
. Seems to have been introduced in the ticket HHH-15428.First request:

Second request:

The text was updated successfully, but these errors were encountered: