-->
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: How to implement a DAO which updates multi table?
PostPosted: Fri Feb 29, 2008 12:55 pm 
Newbie

Joined: Wed Aug 01, 2007 4:00 am
Posts: 8
Hello,

I am using Hibernate3 with Spring 2.

Can somebody show me how to implement a DAO to update two
tables? Let me explain, there are two tables one is for order line
item and the other for products. Whenever a line item is inserted
I need to update the stock in product table. This should came under
same transaction.

Thank you.

Sudheer


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 29, 2008 4:47 pm 
Beginner
Beginner

Joined: Tue Aug 16, 2005 3:44 pm
Posts: 33
Hi!

If you might update the stock with the help of the the database instead of using your application you might be using a trigger.

btw... The are a few ways to write daos :) Are you using a GenericDAO object something like the one described on http://www.hibernate.org/328.html and http://www.ibm.com/developerworks/java/library/j-genericdao.html? If not, you might want to have a look at it.


-Kaj :)


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.