Blazebit / blaze-persistence

Rich Criteria API for JPA providers
https://persistence.blazebit.com
Apache License 2.0
724 stars 84 forks source link

Add API that returns core CriteriaBuilder/FullQueryBuilder from QueryDSL APIs #1645

Open beikov opened 1 year ago

beikov commented 1 year ago

As can be seen in this user question, it is important that we have an API that returns a CriteriaBuilder/FullQueryBuilder, otherwise it's hard to use with entity views.

Also see https://github.com/Blazebit/blaze-persistence/issues/1646, maybe it's worth returning a SelectNewBuilder instead? Or some subtype of it which also allows execution? Maybe we need a type that extends SelectNewBuilder & Queryable?

jwgmeligmeyling commented 4 months ago

Queryable is returned instead of FullQueryBuilder was because of CTE queries (and I think also Set operations, but not sure if these can be paginated). I don't think just SelectNewBuilder & Queryable is enough, because I think Pagination API's have been requested as well.

We can introduce a method that returns the FullQueryBuilder and allow it to fail with a CastClassException for CTE/Set queries but thats going to be confusing.