Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.databases > #65

Possible to map M:M relat

From "Spendius" <spendius@THRWHITE.remove-dii-this>
Subject Possible to map M:M relat
Message-ID <b72c959f-3962-4b87-a88a-fee4f83af4b2@d1g2000hsg.googlegroups.com> (permalink)
Newsgroups comp.lang.java.databases
Date 2011-04-27 15:21 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.databases
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

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.databases | Previous | Next | Find similar


Thread

Possible to map M:M relat "Spendius" <spendius@THRWHITE.remove-dii-this> - 2011-04-27 15:21 +0000

csiph-web