Hello,
I have modelled a parent-child relationship. All is done according to the document that describes the parent chid relationship.
I have one parent and one child object which are connected to each other.
Everything works just fine, when I save the parent object with session.save(parent) the parent and child are inserted into the database. I was wondering how Hibernate reacts when I save the child object instead of the parent object. So I replaced the session.save(parent) by session.save(child) and ran my app again. I thought Hibernate knows how to handle this case, but I received the following exception
Quote:
Exception in thread "main" net.sf.hibernate.PropertyValueException: not-null property references a null or transient value: Parent
I just wonder why can't Hibernate handle this save order?
dee3lmo!