Hi. I have a couple of classes:
Code:
public class Bar {
private String text;
}
public class Foo {
private String text;
private Date date;
private List<Bar> bars;
}
Now, I want to put Foo in one table and Bar in another table. That is easy enough. But I would like to bring the timestamp from Foo into the table of Bar as well so it is possible to partition both tables. However, this is an old datamodel, and I am unable to rewrite it so as to put a date field into Bar. Is it possible to map the date-field of Foo so that it will also be a part of the Bar-table, or is this not possible?
I am imagining something like this:
Code:
<class name="Foo">
<id name="text" column="FOO_TEXT" />
<property name="date" />
......
<list name="bars">
<key column="FOO_TEXT" />
<composite-element>
<property name="text" />
<!-- Reference to date in Foo -->
<ref name="Foo.date" column="DATE" />
</composite-element>
</list>
</class>
Not sure if this makes sense or not, but as I said, the model I work with is old and making changes could be complicated and the possibility for partitioning would be convenient.
Thanks in advance