users@jpa-spec.java.net

[jpa-spec users] Re: JPA_SPEC-25: map back and forth between CriteriaQueries and JPQL queries

From: arjan tijms <arjan.tijms_at_gmail.com>
Date: Fri, 5 May 2017 08:38:58 +0200

Hi Olivier,

On Fri, May 5, 2017 at 8:33 AM, Oliver Gierke <ogierke_at_pivotal.io> wrote:

> We currently fall back on provider specific API to extract the query
> string [0]. Applying a count-projection onto a user-defined query is a big
> use case for our pagination support, again relying on the same mechanism.
>

That's pretty much exactly the same use case as I was referring to
(dynamically applying filtering, sorting and paging to a query). This is an
extremely common requirement, which I encountered on nearly every project I
worked on. Yet to this day JPA supports it extremely poorly.

Kind regards,
Arjan Tijms



>
> However, we mostly need access to the JPQL query currently.
>
> Cheers,
> Ollie
>
> [0] https://github.com/spring-projects/spring-data-jpa/blob/
> d9a08871dbca22ade575929d7254ff7047b22a0e/src/main/java/org/
> springframework/data/jpa/provider/PersistenceProvider.java#L68-L70
>
> > Am 05.05.2017 um 00:27 schrieb arjan tijms <arjan.tijms_at_gmail.com>:
> >
> > Hi,
> >
> > See https://java.net/jira/browse/JPA_SPEC-25
> >
> > This would be an incredible useful feature to have and largely would
> "just" be exposing methods that all persistence providers already seem to
> have internally.
> >
> > Linda herself said:
> >
> > "Being able to map back and forth between CriteriaQueries and JPQL
> queries would be useful to have. This is something that should be
> considered in a future release. See also http://java.net/jira/browse/
> JPA_SPEC-29"
> >
> > Wonder if this could be considered for the MR.
> >
> > Kind regards,
> > Arjan Tijms
> >
>
>