You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
They currently result in contradictions where clauses such as: c.id = 1 and c.id= 2 are generated.
This could be resolved in two different ways:
Multiple jointures (one per clause)
join c as c1 join c as c2 where c1.id = 1 and c2.id = 2
The disadvantage is that we do not control the process that produces the jointures when generating the restriction clause, so it will require significant changes.
Subqueries
where id in (select id from Entity e join e.c where e.c.id = 1) and id in (...)
Advantage: clauses are contained and likely easier to generate.
Drawback: the context to refer to aliases in the root query is not available.
The text was updated successfully, but these errors were encountered:
I'm starting to lean more in favour of subqueries for this. It will ease the Criteria-based filtering service implementation since it already natively supports this via a SubqueryExpression.
For HQL, unfortunately it will not be easy, but there should be enough information in the property meta to generate the jointure necessary in the subquery.
The upside is that by doing this, we will not require the group by clause anymore nor distinct for counting, so there might be a noticeable performance gain.
generate a subquery using a SubqueryExpression for the Criteria-based service
If more information is needed, we might have to make the content of FilteringQueryUtils protected in AbstractQueryFilteringDao so that it can access metadata.
They currently result in contradictions where clauses such as:
c.id = 1 and c.id= 2
are generated.This could be resolved in two different ways:
Multiple jointures (one per clause)
join c as c1 join c as c2 where c1.id = 1 and c2.id = 2
The disadvantage is that we do not control the process that produces the jointures when generating the restriction clause, so it will require significant changes.
Subqueries
where id in (select id from Entity e join e.c where e.c.id = 1) and id in (...)
Advantage: clauses are contained and likely easier to generate.
Drawback: the context to refer to aliases in the root query is not available.
The text was updated successfully, but these errors were encountered: