-->
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: Any suggestion for history data maintain using hibernate?
PostPosted: Thu Feb 14, 2008 10:26 am 
Newbie

Joined: Tue Aug 08, 2006 2:56 am
Posts: 6
Hello,

Just ask a best practice for saving data.

Say that there has 2 tables User_Address, User_Address_History

and the User Address has a mapping hbm.xml file.

When I first time save the data
Hibernate process insert data into User_Address Table,

When I update that record,
Hiberbernate process the update process to update the table data,
and insert a new "same" data into the History table.

Every Update process does cause one insert into History table....

Is there any easy way to do this scenario....

THANK YOU VERY MUCH...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 14, 2008 10:58 am 
Senior
Senior

Joined: Fri Jun 01, 2007 12:41 pm
Posts: 121
Refer to section 12.3.2 Intercepting Hibernate events in Hibernate Book. All you need is to write an interceptor that writes audit logs into history table.


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.