Skip to content

Conversation

@gavinking
Copy link
Contributor

@gavinking gavinking commented Oct 8, 2025

See #65.

@gavinking gavinking linked an issue Oct 8, 2025 that may be closed by this pull request

The argument of the `#key()#`, `#value()#`, or #entry()# function must be an alias of a collection join of a <<collections,map>>, as defined in <<join-clauses>>.

**TODO** This is very restrictive. Should we allow application of `#key()#` or `#value()#` to a path expression?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While the simplified syntax

SELECT key(e.map) FROM Entity e

For Jakarta Query 1.0, we agreed to retain the current rule consistent with historical JPQL semantics:
key(), value(), and entry() apply only to collection join aliases, as in:

SELECT key(p) FROM Entity e JOIN e.map p

We may revisit implicit path-based key()/value() resolution in a later revision (e.g., 1.1) once we can define precise semantics for implicit joins and typing.

Copy link
Contributor Author

@gavinking gavinking Oct 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what you're saying here, @otaviojava.

For Jakarta Query 1.0, we agreed to retain the current rule consistent with historical JPQL semantics:

We did?

Do you mean Jakarta Data 1.0, maybe?

once we can define precise semantics for implicit joins and typing.

"Implicit joins" already have well-defined semantics in Jakarta Query, since they are a long-standing feature of JPQL.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We did?

I remember that we had this concern about break compability.

"Implicit joins" already have well-defined semantics in Jakarta Query, since they are a long-standing feature of JPQL.

Hum, in that case, I would say yes.

@gavinking gavinking merged commit 99e0d3b into jakartaee:main Oct 10, 2025
3 checks passed
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.

define index(), value(), key() functions for collections

3 participants