As you know, in sleep mode, set the id generator to "uuid", then sleep mode will automatically generate the UUID value in the id field when a new object is saved. If the generator setting is “assigned”, the identifier must be assigned a value before saving the object.
And I found that if I set the generator to uuid and assign the id value manually, hibernation will change the value to the new UUID.
My question is: when the generator is configured as uuid, how do I manually assign a value to it?
PS: I use spring HibernateDaoSupport to save.
org.springframework.orm.hibernate3.support.HibernateDaoSupport.save(Ojbect obj)
Thank!
source
share