persistence icon indicating copy to clipboard operation
persistence copied to clipboard

Lift restriction limiting select clause to single-valued expression

Open lukasj opened this issue 11 years ago • 6 comments
trafficstars

Section 4.8 of the JPA spec defines that a select expression is limited to a single-valued path expression.

Since there doesn't seem to be a clear reason for this restriction I would like to request to remove it. This will make it easier to e.g. construct a DTO from an entity where a collection attribute needs to be included.

See also: https://java.net/projects/jpa-spec/lists/users/archive/2014-01/message/0

lukasj avatar Jan 07 '14 22:01 lukasj

  • Issue Imported From: https://github.com/javaee/jpa-spec/issues/69
  • Original Issue Raised By:@glassfishrobot
  • Original Issue Assigned To: Unassigned

lukasj avatar Aug 31 '18 16:08 lukasj

@glassfishrobot Commented Reported by @arjantijms

lukasj avatar Jan 07 '14 22:01 lukasj

@glassfishrobot Commented c.beikov said: This is fixed in JPA 2.1 isn't it?

lukasj avatar Aug 13 '14 09:08 lukasj

@glassfishrobot Commented kithouna said:

This is fixed in JPA 2.1 isn't it?

No, not fixed. Still open!

lukasj avatar Dec 01 '14 14:12 lukasj

@glassfishrobot Commented This issue was imported from java.net JIRA JPA_SPEC-69

lukasj avatar May 05 '17 06:05 lukasj

I'm not keen on this, it reads a bit ambiguously: does the expression author.books refer to the Set<Book>, or the contained Books, i.e. is the collection flattened out or not?

I don't think we should support this, for the same reason we don't currently let you write author.books.title == "Use of Weapons".

gavinking avatar Apr 18 '23 10:04 gavinking