Hi,
I've been trying to implement a many-to-many relationship in
a JobHistory class related to my JOB_HISTORY table with
the following:
....
<class name="test.JobHistory" table="JOB_HISTORY">
<composite-id>
<!-- following OK -->
<!-- <key-property name="empId" access="field" type="long"
column="EMPLOYEE_ID" />-->
<!-- <key-property name="jobId" access="field" type="long"
column="JOB_ID" />-->
<key-property name="emp" access="test.Employee" type="object"
column="EMPLOYEE_ID" />
<key-property name="job" access="test.Job" type="object"
column="JOB_ID" />
</composite-id>
....
The first 2 lines commented run fine (with 'long' variables empId and
jobId in my class),
but when I try to replace these numeric references to class references
(and modify
my class accordingly:
//Long empId;
Employee emp;
//String jobId;
Job job;
public JobHistory() {}
//public JobHistory(Long eid, String jid) {
public JobHistory(Employee eid, Job jid) {
emp=eid; job=jid;
}
... etc.)
I get the following runtime error:
~ identifier mapping has wrong number of columns: \
~ test.JobHistory type: component[emp,job]
I found no solution.
In advance, thanks.
Spendius