hibernate : ternary association mapped by a map (like book page 347)
posted 9 years ago
I have a unidirectional ternary association like page 347 of the book between Person (Category in the book), Category (Item in the book) and Career (User in the book). The difference is that the person_id and the category_id are not nullable but the Career_id can be null in the association table. When I try to save a Person with a Category in the key of the map but null in the value. No insert occurs in the PERSON_CATEGORY table.
Is there a way of "telling" hibernate in the mapping to insert a line in PERSON_CATEGORY if the career is null ?
works perfectly well but when I try to read the person with id2 the null Career doesn't appear.
Here my unit test fails because my Map is empty. And it shouldn't because the "manual" insert worked well.
Here are my details.
Hibernate version:3.2.2 ga
Code between sessionFactory.openSession() and session.close():
Name and version of the database you are using: hsqldb v 1.8
The generated SQL (show_sql=true):
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads