Hi,
I have a composite id with a composite key class like that
Code:
<class name="Foo" table="foo">
<composite-id name="comp_id" class="FooPK">
<key-property name="foo1"/>
<key-many-to-one name="bar class="Bar"/>
</composite-id>
</class>
What do I have to put in both Foo and FooPK classes?
Can I have get/setBar methods in the Foo class ?
When I use hbm2java these accessors are only in the FooPK class but I would like to have them in the Foo class. If I want to do so, do I have to implement them with delegate to FooPK i.e. :
Code:
public Bar getBar()
{
return comp_id.getBar();
}
public void setBar(Bar a_bar)
{
comp_id.setBar(a_bar);
}
or do I have to dupicate the bar attribute in the Foo class (but in this case which attribute is saved ?).