Open njr-11 opened 1 week ago
See EclipseLink Issue : 2182
@njr-11 From the EclipseLink community (see https://github.com/eclipse-ee4j/eclipselink/issues/2182) :
given that If the domain has exactly one named entity abstract schema type and no joins, then the named entity does not require an explicit identification variable, and its identification variable defaults to the implicit identification variable, this. one should use either SELECT hexadecimal FROM AsciiCharacter hexadecimal WHERE ...
or SELECT this FROM AsciiCharacter WHERE ...
So, agreement that use of an identifier on the "FROM" clause is optional, but when omitted, it defaults to "this", and therefore the identifier "hexadecimal" may not be used elsewhere, but instead it should be "this".
I confirmed that the wording above is from the JPA 3.2 final spec; though I'm not sure where exactly this is covered in the Data spec. Someone familiar with Jakarta Data needs to do one of the following:
I added a reply in the EclipseLink issue to challenge their interpretation of the Jakarta Persistence 3.2 specification on this.
EcilpseLink is rejecting JPQL SELECT clauses where the entity attribute omits the optional entity identification variable. For example for,
SELECT hexadecimal FROM AsciiCharacter WHERE hexadecimal IS NOT NULL AND thisCharacter = ?1
, EclipseLink raises an error: "The identification variable 'hexadecimal' is not defined in the FROM clause". It shouldn't need to be defined the from clause because this JPQL query is intentionally written without the entity identification variable to be consistent with JDQL.