Hello everybody, I´m trying to complete a task using some of it. I´ve two classes: Emp and Func.
in Emp.hbm.xml:
Code:
...
<map name="funcs" table="func_emp" lazy="true">
<key column="emp" />
<composite-index class="pack.Emp">
<key-many-to-one name="funcionario"
class="ime.sodc.model.desastre.Funcionario" />
</composite-index>
<composite-element class="pack.Func">
</composite-element>
</map>
...
My Emp.java has something like this:
Code:
private Map funcs = new Hashtable();
private Func func;
When I perform a test using this, I´ve to do:
Code:
Emp emp = (Emp)aSession.load(Emp.class, idEmp);
Func func = (Func)aSession.load(Func.class,idFunc);
emp.setFunc(func);
emp.getFuncs().put(emp,func);
I don´t want to set the func in emp, I don´t know how to resolve it. Can anyone help?
Thanks for all.