-->
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: History Management
PostPosted: Thu Sep 15, 2005 10:46 am 
Newbie

Joined: Thu Sep 15, 2005 10:42 am
Posts: 1
I like do history management with my Objects in Hibernate. The history management meaning that the Objects loaded into my application correspons to the valid Objects for a TimeStamp specified as parameter.

I have the class

class Policy{

TimeStamp timestamp;

ArrayList riskgroups;

void add(RiskGroup riskgroup){
riskgroups.add(riskgroup);
}

}

class RiskGroup{

TimeStamp timestamp;

ArrayList insurances;

void add(Insurance insurance){
insurances.add(insurance);
}

}

class Insurance{

TimeStamp timestamp;

}

I have created one Policy's object, and two RiskGroup's objects. The first RiskGroup has TimeStamp T1 and the second RiskGroup has TimeStamp T2. Both RiskGroups are aggregated to the Policy by the method add().
Each RiskGroup has two Insurance's objects, Insurance for T1 and Insurance for T2. I like load the Policy's object for T1 or T2. When the T1 is specified, them the first RiskGroup with TimeStamp T1 is loaded and this load the Insurance with TimeStamp T1. However, if T2 is especified the the second RiskGroup is loaded and it load Insurance for T2.

Is posible that management in Hibernate ? Where is available samples or information for this management ?

_________________
Cesar Rodriguez
Tecnologia
ibSoft Development
Caracas, Venezuela


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 28, 2005 6:39 am 
Newbie

Joined: Wed Sep 28, 2005 4:07 am
Posts: 11
Hibernate does not support any History-Management. So you have to implement the code concerning the History in your Entities.

I am very experienced with History-Frameworks. And I am a bit worried about your Database-Design. I think it is not in 2nd normalform. So you should split all your History classes into 2 classes (and 2 tables).
The most important thing is not to fill your application code with History-Management. You should write a Framework-class, that manages the List of PolicyData, RiskGroupData and InsuranceData (see below).


Here is how you should split the classes:
[code]
class Policy{

ArrayList riskgroups;
ArrayList policyData;

void add(RiskGroup riskgroup){
riskgroups.add(riskgroup);
}

}

class RiskGroup{

ArrayList insurances;
ArrayList riskGroupData;

void add(Insurance insurance){
insurances.add(insurance);
}

}

class Insurance{
ArrayList insuranceData;
}

class PolicyData{
TimeStamp timestamp;
...
}

class RiskGroupData{
TimeStamp timestamp;
...
}

class Insurance{
TimeStamp timestamp;
...
}

_________________
Lars Fiedler


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.