These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: assigned id and && previously saved instance
PostPosted: Tue Jan 25, 2005 1:25 pm 
Newbie

Joined: Tue Jan 25, 2005 1:00 pm
Posts: 5
Location: france
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,


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 25, 2005 1:36 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
undefined basically means that the database will be hit if there is no other way (version/timestamp/interceptor) to determine if the object is unsaved or not.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.