Hibernate version:
2.1.2
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
Oracle 9.2.0
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
I am working with a complex data model that Hibernate seems to be struggling with. If anyone has done something similar, or knows the answer to the following scenario, I would appreciate your help.
The following is an example of what we are trying to do:
Code:
Product - 1 -----------------------0..*---< Product Language
1 1
| |
| |
| |
0..* 0..*
| |
/\ /\
Product Feature --1------------- 0..* --< Product Feature Description
Note: We are using Oracle to enforce foreign key constraints between the tables.
Deleting from the collections does not seem to be an issue. However, inserts do not happen in the right order. Adding a new Product Feature with a new Product Feature Description will try to add the Product Feature Description as a child of the Product Language first, and then add the Product Feature. This will cause an exception to be thrown indicating that a parent child relationship has been violated. Does anyone know of a way to deal with this in Hibernate?
Cascade for the collections is set to all-delete-orphans, and inverse is set to true on the collections in both ProductLanguage and ProductFeature which contain ProductFeatureDescriptions.
Thanks for the help,
Shawn Vincent