persistence
persistence copied to clipboard
Clarify semantics of BindableType
BindableType has three values SINGULAR_ATTRIBUTE, PLURAL_ATTRIBUTE, ENTITY_TYPE.
For an entity like this:
class User {
private User manager;
}
The lookup of the bindable type for the manager property returns ENTITY_TYPE on Hibernate and SINGULAR_ATTRIBUTE on EclipseLink. I'd argue the latter is wrong as the existence of ENTITY_TYPE indicates that it should be preferred over SINGULAR_ATTRIBUTE if the attribute indeed is a JPA entity. The spec however is completely silent on this and doesn't define any strict rules.
- Issue Imported From: https://github.com/javaee/jpa-spec/issues/106
- Original Issue Raised By:@glassfishrobot
- Original Issue Assigned To: @ldemichiel
@glassfishrobot Commented Reported by oliver.gierke
@glassfishrobot Commented This issue was imported from java.net JIRA JPA_SPEC-106
This seems like low-hanging fruit that could be looked at in the next release and resolved one way or the other? It does appear to be a fairly low priority either way.
Reza Rahman Jakarta EE Ambassador, Author, Blogger, Speaker
Please note views expressed here are my own as an individual community member and do not reflect the views of my employer.
So, okay, this was indeed very slightly ambiguous, though I note that Hibernate already fixed the indicated inconsistency, probably long ago. Anyway, I've "fixed" this issue in #468 by adding some @see
annotations to the Javadoc.