aspose file tools*
The moose likes Object Relational Mapping and the fly likes Need to delete record and add record in one method. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Need to delete record and add record in one method." Watch "Need to delete record and add record in one method." New topic
Author

Need to delete record and add record in one method.

sam White
Ranch Hand

Joined: Feb 18, 2011
Posts: 208
Hi, with spring mvc 3.0.5 and hibernate 3, I have created a dao/service web service layer for interacting with mysql 5.

When user click the submit button, my application require to delete all related records from a table then add another set data to the table.
I wonder how to achieve that.

The remove() method is written as below:








I am also thinking use begingTransaction and endTransaction around the removeall() and create() function, but I don't know how and not even sure whether that can solve my problem.

Any suggestion would be very appreciated.
Thanks
Sam
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1669
    
    7

Please post the exception you are getting as well. This saves people a lot of time finding the problem.


[How To Ask Questions][Read before you PM me]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need to delete record and add record in one method.