-->
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.  [ 1 post ] 
Author Message
 Post subject: create history data and restore from history data
PostPosted: Tue Nov 22, 2005 8:06 pm 
Newbie

Joined: Sat Oct 30, 2004 4:00 am
Posts: 11
hi all,
In every system, we usually have to create history data and restore from history data.

History data is not just a single entity, but a graph of entities. For example, order -> order details -> line item...

It cost much if we design the same table structure for history data exactly same as main data, for example: orderHistory -> order detailHistory -> line item History...
It cost much more for coding to copy data between main ⇔ history data(id value of main entity and history entity is different).

My solution is:

using replicate function of hibernate 3 to transform main data to xml, serialize to history DB.


Each time restoring data from history ⇒ main,
load xml data from history DB,
deserialize to entity in session


save entity back to main table

Advantage:
cost of design history table =0
code for copy history⇔main = 0

I do not implement yet, but my questions is how to restrict only a part, not all data graph is serialized to xml?

you have any good ideas?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.