I think I really have problems in understanding the usage of unsaved-value.
class X ...
id .... unsaved-value = "any/none/null.."
generator = "assigned"
class Y
id ... unsaved-value = "null"
generator = "sequence"
many-to-one = x cascade= "save-update"
I really have doubts to solve the unsaved-value problem for the assigned id.
if I used the generator = " sequence" for X id, and define unsaved-value="null", it works correct since it calls save when id is null or else update if the id is not null.
but for generator = " assigned", what should I set the unsaved value to force hibernate to act as :
saveOrUpdate(y) :
saving y..
saving or updating x? // many-to-one cascade
if x is in the session(db), update x
else save it
x saved or updated
y saved
_________________ -developer
|