I have my code posted in
http://forum.hibernate.org/viewtopic.php?t=932541 Do lazy loading one-to-one mappings, database generated Ids, and cascading inserts just not go together? Is this because the constrained clause is used for two purposes?
purpose 1) tell hibernate which side of the mapping to load first
purpose 2) tell hibernate wether or not a mapped is required.
It seems, on the parent, I have to set constrained = false if I wish to save the parent, get the identity column generated id and then save the child. I need to set constrained = true on the parent if I wish to lazy load the child. What am I missing? It seems that the only way to resolve this is save the child manually instead of letting hibernate use a cascading save. Should I submit this as a bug or am I just confused?
--Angus