I try to map the following object model to a legacy database:

public abstract class A

public abstract class X extends A
public abstract class Y extends A
public abstract class Z extends A

The classes X, Y, Z map to different legacy tables (TableA, TableB, TableC)
and the primary keys are not unique among the different tables.
I.e. the number 21 might be a valid primary key for TableA as well es for
TableB.
All works fine if I query by concrete class or the query by base class does
not
return overlapping IDs.
However OJB seems to get confused (which seems quite logical to me) if I
query by base
class and there are multiple IDs returned for different concrete classes.
I could work around this problem by using database views which manipulate
the primary keys,
but that works only for reading from the database.

Are there any ideas how to deal with this problem?
Would it help to use the PersistenceBrokerAware interface to fake the ID
values after
loading the objects?

Thank you in advance,
Achim


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

Reply via email to