persistence icon indicating copy to clipboard operation
persistence copied to clipboard

Clarify semantics of BindableType

Open lukasj opened this issue 9 years ago • 4 comments

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.

lukasj avatar Apr 01 '15 10:04 lukasj

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

lukasj avatar Aug 31 '18 16:08 lukasj

@glassfishrobot Commented Reported by oliver.gierke

lukasj avatar Apr 01 '15 10:04 lukasj

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

lukasj avatar May 05 '17 06:05 lukasj

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.

m-reza-rahman avatar May 06 '21 21:05 m-reza-rahman

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.

gavinking avatar Aug 15 '23 22:08 gavinking