I need to have a object whose identity is defined by the composite of the keys for 4 child objects. These child objects will not have a foreign key relationship with the parent, but will be defined at query time by a join.
So the object Roster, is queried by a timeStamp, and the child objects, Student, Teacher, School, Class, will very depending on what timeStamp you are querying for.
So at "1/1/2000 ..." the roster may have these 10 student, teacher joe, etc
But at "1/2/2000 ... " the roster may have 9 students and teacher pat, etc..
we can't really make a new set of rows everytime anything is changed, because the changes are too frequent, and the changes and queries are too frequent.
I am thinking of using
<composite-id
<generator class="foreign">
<param name="property">student</param>
</generator>
<generator class="foreign">
<param name="property">teacher</param>
</generator>
<generator class="foreign">
<param name="property">school</param>
</generator>
<generator class="foreign">
<param name="property">class</param>
</generator>
</composite-id>
but cannot find any examples of doing this.
Any ideas>
|