Hello world,
I know the topic has been already debated in a large way so apologize
for this new post but i need to make things a bit clearer.
I need to declare dome of my id in my O/R mapping files as assigned.
And not with a sequence or things like that (i mean i cannot put a rule
like unsaved-value="0" to mention what has to be saved or update).
My Ids really comes from a domain logic in my legacy database ...
So i would like to know where is the state of the art on this problem.
I found two workarouds for this :
First, on
http://www.hibernate.org/116.html#A11, i read about mapping unsaved-value="undefined" for my ids if use in Hibernate 3.0 beta 1 or
more ...
Even, i feel about frightened with a beta release on my production environment, i wonder what "undedefined" mean...
Is that mean the id had to be a specific undefined java value (which one?)
or it is that mean it can work with any value (and force a save each time the id does not exisys in the Base?)?
The second solution i'm interested in is implementing an Interceptor.
I would be glad if someone could supply some link about this technique.
I'm also worried about how to test it in a Junit context (while it's not a servlet engine).
Thx,