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
|