You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just found out that the following leads to different results in EclipseLink and Hibernate. And I can't decide from looking at the Spec which is the correct behavior:
CriteriaBuilderbuilder = em.getCriteriaBuilder();
CriteriaQuery<User> query = builder.createQuery(User.class);
Root<User> root = query.from(User.class);
root.get("manager");
// this returns 1 in EclipseLink and 0 in Hibernate.root.getJoins()
User is an entity with manager being a self-reference (I don't think the "self" part is relevant here).
@EntitypublicclassUser {
@Id@GeneratedValue(strategy = GenerationType.AUTO) privateIntegerid;
@ManyToOneprivateUsermanager;
// getters and setters omitted for brevity.
}
Please clarify in the specification and in the TCK which one it should be.
The text was updated successfully, but these errors were encountered:
This seems like low-hanging fruit that could be looked at in the next release and resolved one way or the other? I would say this is not that high of a 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.
I just found out that the following leads to different results in EclipseLink and Hibernate. And I can't decide from looking at the Spec which is the correct behavior:
User
is an entity withmanager
being a self-reference (I don't think the "self" part is relevant here).Please clarify in the specification and in the TCK which one it should be.
The text was updated successfully, but these errors were encountered: