Hi,
Stijn de Witt wrote:
Thanks for your message, it clears up a lot.
I guess I'll use the PB api then. Do you know if/when this will be fixed for ODMG?
I will try to fix this, but I can't give a time frame when it will happen (much other stuff to do).
Thanks for your responses to all the little questions too. If have some new in reaction to your answers, please read below...
Armin Waibel wrote:
Hi Stijn,
at the end of writing this mail I found that you are using "inheritance hierarchy to multiple joined tables" for Candidate. The ODMG-api doesn't work properly with this feature (PB-api does, sorry this was only noted in 1.0.1 release-notes). Additionally you define in Person class-descriptor Candidate as extent class. Mixing these features doesn't make sense (think so). So remove the the 'super' reference in Candidate and only use 'extent' the feature to tell OJB about the hierarchy.
Can you explain the part about the extent and super a bit more?s
With extent-class attribute you can declare object hierarchies
http://db.apache.org/ojb/docu/guides/advanced-technique.html#Extents+and+Polymorphism
Declare tags for Person and Candidate independently (all fields declared in Person have to be declared in Candidate too). Then xdoclet automatic creates an extent-class entry in Person
http://db.apache.org/ojb/docu/guides/xdoclet-module.html#ojb.extent-class
Now you can query for all Person.class and OJB will return a Collection of all Person and Candidate objects.
If you use the "super" reference (declare all field again in both classes) the DB "sub"-table only contain the PK,FK column and the additional columns for the sub-class ('determine-extents' should be set false in super class).
If you query for all Person.class OJB will return a Collection of Person objects containing all Person objects and the Person part of all Candidate objects (but AFAIK no Candidate objects). If you query for Candidate OJB return a Collection of Candidate objects by read data from both tables.
regards, Armin
I am using OjbDoclet. Here are the xdoclet comments for Person and Candidate:
/** * @ojb.class table="bit_Person" */ public class Person { /** * @ojb.field name="id" * primarykey="true" * jdbc-type="INTEGER" * length="11" * autoincrement="ojb" */ protected int id;
/** * @ojb.class table="bit_job_Candidate" * include-inherited="false" * @ojb.reference class-ref="nl.bergland.codamo.Person" * name="super" * foreignkey="id" * auto-retrieve="true" * auto-update="true" * auto-delete="true" */ public class Candidate extends Person { /** * @ojb.field name="id" * primarykey="true" * jdbc-type="INTEGER" * length="11" * autoincrement="ojb" */ protected int id;
I am worried about the id field too. It's duplicated in Candidate, but that shouldn't be necessary should it?
Greetings,
-Stijn
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
