-
Notifications
You must be signed in to change notification settings - Fork 101
Open
Labels
component: jpa-criteriakind: enhancementworth: highImplementing this has a high worthImplementing this has a high worth
Milestone
Description
As shown in the user question it is hard to compose JPA Criteria parts into a bigger query. My suggestion is to add the following to BlazeCriteriaQuery
:
public void applyToCriteriaBuilder(BaseCriteriaBuilder<T> builder);
This will allow users to compose a query like this:
CriteriaBuilder<Tuple> cb1 = factory.create(em, Tuple.class);
query1.applyToCriteriaBuilder( cb1 );
LeafOngoingSetOperationCriteriaBuilder<Tuple> cb2 = cb.unionAll();
query2.applyToCriteriaBuilder( cb2 );
FinalSetOperationCriteriaBuilder<Tuple> finalCb = cb2.endSet();
finalCb.orderByDesc("statusChangedAt").orderByDesc("id")
To fully solve the problem for the user we'd also need #1556 though.
Metadata
Metadata
Assignees
Labels
component: jpa-criteriakind: enhancementworth: highImplementing this has a high worthImplementing this has a high worth