-->
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: Is it possible to map in Hibernate following table?
PostPosted: Mon Aug 29, 2005 8:56 am 
Newbie

Joined: Tue Aug 02, 2005 7:15 am
Posts: 3
We have tables where historical data are stored together with up-to-date data. If data are historical they have column ST set to 1, if they are up-do-date they are set to 0. Primary key consists of columns DV and PM. DV is unique id of a row in a table and PM is unique id of an entity. Only one row with the same PM has ST=0. If the row is updated, then trigger updates current row by setting ST to 1, and inserts new row to table with the same PM and new DV. This new row is now the current row. Example:
1. The first row is inserted: DV=1, PM=1, ST=0, DATA='AAA'
2. The second row is inserted: DV=2, PM=2, ST=0, DATA='BBB'
3. The first row is updated - we have then 2 rows with PM=1:
DV=1, PM=1, ST=1, DATA='AAA'
DV=3, PM=1, ST=0, DATA='AAB'

The problem is: is it possible to map such datatable in Hibernate? If answer is yes, then how it should be done?


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.