Replies: 1 comment
-
|
Look, the criteria API isn't perfect, but it's about as good as you can get given the following design constraints:
JOOQ, naturally, doesn't have to deal with the verbosity of And your proposal doesn't allow multiple roots. And your JOOQ example is also not using multiple roots. (It's possible in JOOQ, but it's more verbose.) So, yes, relaxing these requirements leads to a much more streamlined API. And that's why we've already introduced precisely such an API in Jakarta Data spec. I don't think that Persistence should introduce an API that competes with Data. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
One of the reasons I like JPQL is it simplifies the work needed to translate to SQL in my head.
But it does introduce the notion of adding another language inside another language. Plus that language was designed for reporting https://x.com/unclebobmartin/status/1917410469150597430
Anyway I know we have the criteria API, but that doesn't translate easily to SQL when reading through it.
I was thinking maybe we can have an API like JOOQ DSL to reduce the boiler plate
Using ChatGPT I just asked it to create a comparison of SQL, JPQL, JPA Criteria API and JOOQ
JPQL API
Criteria API
JOOQ
So given the choices, JPQL for me is the most favorable.
Conceptual idea
So my conceptual idea is rather than having CriteriaBuilder, CriteriaQuery we manage everything through a
dsl()method and let the code generator generate similar API to JOOQor
Beta Was this translation helpful? Give feedback.
All reactions