Hi Saleem,
Saleem Shafi wrote:
To be perfectly honest, i'm not 100% sure this problem is restricted to inheritance over multiple tables, but that's the configuration i'm running into the problem with.
Inheritance over multiple tables was currently only supported by the PB-api.
> Does anyone know of any way around this mess other than dropping the > foreign key constraint? >
Sorry I don't.
Will try to fix the ODMG-api to support "Inheritance over multiple tables" too, but I can't give you a time frame (much other stuff to do). Any help would be appreciated ;-)
regards, Armin
Here's the setup: i've got a base class (Role) and a subclass (Faculty). There's a ROLE table and a FACULTY table and it's mapped according to the description of option #3 in the guide. Role defines a 1-to-1 relationship with Person and there's a column in the ROLE table that corresponds to the pk of the PERSON table.
In the code, i create a Person object and a Faculty object and set the reference on Faculty (inherited from Role) to the newly created Person. Depending on how i setup my descriptor for Role, i run into 1 of 2 problems. 1) If i set the auto-update flag on the Person reference descriptor to 'true', i get an SQL exception complaining about cannot insert duplicate key on Person because when the Role object (added to the transaction when i locked Faculty, i assume to handle persisting the necessary information to the ROLE table) tries to insert into the Person table in accordance with the auto-update flag, but of course, so does the actual Person object. Or, 2) if i set the auto-update flag to false, committing the Role fails because of the inability to satisfy the foreign key relationship to Person.
In situation #1, i would expect OJB to recognize that it has already inserted the Person object and does not need to do so again; and, in situation #2, i would expect the reorder() method in the ObjectEnvelopeTable to recognize that the Role needs to be committed after Person. I realize that OJB doesn't know anything about my foreign key constraints on the database, but i couldn't find any way to explicity define the dependency between the two objects.
Does anyone know of any way around this mess other than dropping the foreign key constraint?
Saleem.
--------------------------------------------------------------------- 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]
