persistence
persistence copied to clipboard
Lift restriction limiting select clause to single-valued expression
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
- Issue Imported From: https://github.com/javaee/jpa-spec/issues/69
- Original Issue Raised By:@glassfishrobot
- Original Issue Assigned To: Unassigned
@glassfishrobot Commented Reported by @arjantijms
@glassfishrobot Commented c.beikov said: This is fixed in JPA 2.1 isn't it?
@glassfishrobot Commented kithouna said:
This is fixed in JPA 2.1 isn't it?
No, not fixed. Still open!
@glassfishrobot Commented This issue was imported from java.net JIRA JPA_SPEC-69
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".