JPA: contains()/in() don't work for member collections
Bug #847607 reported by
Maia Everett
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Querydsl |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
I have two classes with a one-to-many association through a List. When I try to make a query using contains() or in() with the member collection, JPAQuery generates an IN ELEMENTS() query, which is Hibernate-specific. Instead, it should use MEMBER OF, which is part of the JPA standard.
As a workaround, currently I use the reverse mapping reference for comparison, i.e. q2.parent.eq(q1) instead of q1.children.
Changed in querydsl: | |
status: | In Progress → Won't Fix |
To post a comment you must log in.
The JPAQuery uses HQLTemplates by default because we prioritize Hibernate compatibility. For JPA 2 standard compliant JPQL use JPQLTemplates. DEFAULT instead.
e.g.
JPAQuery query = new JPAQuery( entityManager, JPQLTemplates. DEFAULT) ;