Hello -
I am having some difficulty with extents - something that OJB should handle nicely.
I have a Project class persisted in a table called PROJECTS.
I have a Person class persisted in a table called PEOPLE.
I have a PrimaryInvestigator class that extends Person.
The PrimaryInvestigator class has some additional fields - like a projectId (which project they are the PI for).
The PrimaryInvestigator info that comes from a Person should still be stored in the PEOPLE table, but the PI-only info should be stored in a table called PROJECT_PI - basically a join table between PEOPLE and PROJECTS that looks like this:
------------
person_id
project_id


For some reason, I cannot get the mapping correctly. Can anyone give me some insight as to how to write the mapping?
I tried to use:
<class-descriptor class="PrimaryInvestigator" table="PROJECT_PI" extends="Person">
.....
</class-descriptor>


But there really is no documentation about how to use the "extends" attribute.
Even so, it doesn't work for me, OJB complains about not all fields being set for PreparedStatement insert of Person object.


I also tried to do:
<class-descriptor class="Person" table="PEOPLE">
.....
  <extent-class class-ref=PrimaryInvestigator">
</class-descriptor>

But that doesn't quite work either - and I don't want to have to store the name of the object in the PEOPLE table - as described in the docs if you use the same table for extents.

Can anyone help?

--Bobby

--
----------------------------
Bobby Lawrence
MIS Application Developer

Jefferson Lab (www.jlab.org)

Email: [EMAIL PROTECTED]
Office: (757) 269-5818
Pager: (757) 584-5818
----------------------------





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to