This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
(Another point is, when I annotate the @OneToOne above the getter instead above the field, then Hibernate totally ignores my OneToOne-Mapping and recognices the Item-Instance (or Product-Instance) as a column instead of a relationship, hence it produces false sql-selects)
I have also tried to use the PrimaryKeyJoinColumns-Relation in Class Product:
and delete the relation in Class Item (to make the oneToOne at least unidirectional):
Doing that HQL:
returns the same failure:
Do I have to use Hibernates ForeignGenerator within my Item-Class (I have a composite key!) ?:
Please, can you say me: What is wrong with my mapping?
It is really hard to believe that such a OneToOne-Mapping with a composite key is so hard to implement by using ORM (Hibernate).
Such relationships are very common.