Let's say we have two classes Customer and Order that have a connection between them. One Customer may have zero, one or many Orders associated.
If I create a Criteria query to read the Orders of a specific Customer I would pass the Customer object as a parameter to the query. In the resulting set of Orders it seems that they are connected to another Customer object with the same data (i e a different object identity). This is not the behaviour I want in my app. What do I need to do to make it return the same Customer object connected to the Order(s)?
I have not implemented the equals() method of my classes (they are generated from EMF). Is this a factor here? Is there any way I can configure Hibernate and/or my query to get my desired behaviour? I am also using Teneo since I am using EMF, but to me this seems to be a Hibernate issue, not a Teneo issue.
|