-->
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: Lifecycle Callbacks - equivalent for "post" insert
PostPosted: Tue Jul 06, 2004 12:49 pm 
Beginner
Beginner

Joined: Thu May 20, 2004 3:40 pm
Posts: 33
Hello!!

Is there an equivalent interface like Lifecycle, that will allow you to do insert(), updates(), etc. to other tables after an insert to an existing table??

For example:

If I have TABLEA and TABLEB.

IF insert and commit into TABLEA
insert into TABLE B and commit insert
ELSE if duplicate entry in TABLEA
do nothing; continue;

If not, how can I handle the situation above in hibernate?? Do I just have to catch the duplicate exception and manually do the next insert???


Thanks,

kjsanchez


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 06, 2004 12:51 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
The best would be a trigger in the database, but you can also implement a Hibernate interceptor that uses a "second session". Read this: http://blog.hibernate.org/cgi-bin/blosx ... ggers.html and search the Hibernate Wiki.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 06, 2004 1:00 pm 
Beginner
Beginner

Joined: Thu May 20, 2004 3:40 pm
Posts: 33
Thanks Christian for the quick reponse!!!

I will take a look.

Thanks,

Kenny


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.