Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

introduce id() and version() functions #596

Merged
merged 2 commits into from
Mar 25, 2024
Merged

Conversation

gavinking
Copy link
Contributor

@gavinking gavinking commented Mar 16, 2024

  • this is the most minimal form of this which supports what we want to do in Jakarta Data
  • for now, only allow them in comparison expressions with input parameters
  • also make the section on Entity Type Expressions more readable

@see #594

@gavinking gavinking linked an issue Mar 16, 2024 that may be closed by this pull request
- this is the most minimal form of this which supports
  what we want to do in Jakarta Data
- for now, only allow them in comparison expressions
  with input parameters
- also make the section on Entity Type Expressions more
  readable
@gavinking
Copy link
Contributor Author

@lukasj The reason I'm proposing this now, even though it seems like something that's otherwise highly non-urgent at best, is that:

  • We're about to write down something a bit inelegant in the Jakarta Data spec, and, while it's bearable, I would prefer not to have it there frozen in stone until Jakarta is exterminated in the AI apocalypse.
  • @njr-11 is doing an implementation of Jakarta Data on EclipseLink, and I believe that this would make his life at least slightly easier.

It's not critical, but it would be nice.

@lukasj lukasj merged commit 63546e6 into jakartaee:master Mar 25, 2024
2 checks passed
gavinking added a commit to gavinking/jpa-api that referenced this pull request Mar 26, 2024
lukasj pushed a commit that referenced this pull request Mar 28, 2024
rfelcman added a commit to eclipse-ee4j/eclipselink that referenced this pull request Apr 9, 2024
…2108)

Implementation plus unit test according jakartaee/persistence#596

There are two new JPQL functions:
- `ID(...)` to fetch Entity `@Id` value. There is support for single or composite primary key
- `VERSION(...)` to fetch attribute value from attribute marked by `@Version` annotation

These functions are specific as they are exist in JPQL only, but not in SQL like other JPQL functions where are usually similar SQL function/procedure at the DB side.

Signed-off-by: Radek Felcman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'id()' function
2 participants