-->
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.  [ 3 posts ] 
Author Message
 Post subject: Interceptors OnSave id is null??
PostPosted: Thu Jan 15, 2009 2:40 pm 
Newbie

Joined: Tue Jan 13, 2009 12:35 pm
Posts: 4
So I'm trying to implement an EmptyInterceptor but the id of the OnSave method is always null. Is that expected? How do you determine the id of something that was created?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 16, 2009 3:04 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
I'm not sure if that's true in general, but at least for DB generated id's I would say they're simple not yet generated. In this case the id is generated during the insert which happens far later. But probably that's the fact in general.

Try AfterTransactionCompletion or PostFlush, they should definetly be generated until then.

_________________
--Wolfgang


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 16, 2009 2:32 pm 
Newbie

Joined: Tue Jan 13, 2009 12:35 pm
Posts: 4
wolli wrote:
I'm not sure if that's true in general, but at least for DB generated id's I would say they're simple not yet generated. In this case the id is generated during the insert which happens far later. But probably that's the fact in general.

Try AfterTransactionCompletion or PostFlush, they should definetly be generated until then.



Thanks again, I ended up getting them in PostFlush.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.