[BUG] Collection .contains() not working anymore
The bug I raised 5 months ago is not fixed in 6.1 or 6.2:
https://github.com/querydsl/querydsl/issues/3618
Just to mention that I tried with com.querydsl 5.1.0 and openfeign.querydsl 6.2.1 published on Apr 09, 2024 and the bug is still there. Switched to my own stored procedure to do the job properly but still hoping this will be fixed one day in the future.
I don't think this is a bug. This is caused by you providing an incomplete custom mapping.
The roles property is a Set, so member of is the correct JPQL to use. You are providing a Set <-> TEXT converter, but no matching implementation for the member of operator.
Hibernate 6 added a lot more checks and validation to its query processing, so it won't allow this type mismatch any more.
What was the generated SQL for them before? I cannot see how they would have ever worked properly.
@OrangeDog Hi! That worked before for sure, but if there was a bug in earlier releases, I managed it to work with those converteds and annotations. I'm not claiming this should work again, the idea is to report a bug as a radical behaviour change. Generated SQL statements are presented here: https://github.com/querydsl/querydsl/issues/3618#issuecomment-1867621756
@H-Lo those are the JPQL queries, not the SQL queries.
I don't think there was any change in QueryDSL, radical or otherwise. It was a change in Hibernate.
My bad. I give up on this, I wrote stored procedures and now using them instead and I can live with it. If you have a hint what to do with my code to fix it, I can give it a try.
matching implementation for the
member ofoperator
https://docs.jboss.org/hibernate/orm/current/userguide/html_single/Hibernate_User_Guide.html#bootstrap-jpa-metadata
You may also find it useful to create a custom QueryDSL method, to generate a different JPQL than member of.
As I don't know what SQL you are expecting to work to achieve this query, I cannot help further.
If you can change your schema, I would use a native ARRAY type, which has full JPA support in Hibernate via the array_contains function.
Seems no one is working on this, I'm closing to clear the board. Feel free to reopen after a PR is submitted.