For a very long time, the query language in Hibernate has allowed you to refer to the identifier of an entity via the syntax id(foo), and the version using version(foo). It was never clear that this was especially useful for anything, so I've never proposed it here.
However, it turns out that id() is really useful for defining generic repository interfaces in Jakarta Data, and we have really been going in circles and inventing quite nasty workarounds due to its absence in JPQL. And I think that version() will be useful for similar reasons.
I propose that we add the id() and version() functions to JPQL.
For a very long time, the query language in Hibernate has allowed you to refer to the identifier of an entity via the syntax
id(foo)
, and the version usingversion(foo)
. It was never clear that this was especially useful for anything, so I've never proposed it here.However, it turns out that
id()
is really useful for defining generic repository interfaces in Jakarta Data, and we have really been going in circles and inventing quite nasty workarounds due to its absence in JPQL. And I think thatversion()
will be useful for similar reasons.I propose that we add the
id()
andversion()
functions to JPQL.