hi steve,


Steve Clark wrote:
Is there really nobody out there who has any thoughts on this?  I'm
completely stuck, and would appreciate any insight.  I basically
cannot get inherited relationships to work correctly.

I have an inheritance hierarchy that I'm having real problems mapping
correctly (well, let's say usefully).  I have an abstract superclass
Sup with two subclasses Sub1 and Sub2.  Elsewhere in the model, I have
classes which have relationships to Sup, to Sub1, and to Sub2.  I need

when these classes refer to Sup are you also interested in the extents ?

to be able to query against things like A.Sup.C.attr1, A.Sup.attr2,
B.Sub1.C.attr1, and B.Sub1.attr3; and I need to have collections of
Sup's as well as collections of Sub1's.

you could try to use pathclass-hints to define exactly what class you expect for a given path-segment.



Currently, I've mapped this to two tables, SUB_1 and SUB_2. I have defined Sup as having two extents, Sub1 and Sub2. I have replicated all of the shared reference- and collection-descriptors in all three class-descriptors. My problem (see an email I sent yesterday) is that queries through a shared relationship from Sup end up with non-deterministic outer joins (is it A3.attr1 or A3C0.attr1?); indeed, I'm not clear that a correct query can always be written.

could you please post the sql.

So now I'm considering the other mapping possibilities.  I'd prefer
the three-table (SUP, SUB_1, and SUB_2) solution with 'super'
reference.  It seems clear that all queries through Sup.xxx will work
fine here, because the multiple extents don't become an issue and
there are no alternate outer joins.  Also, I'm confident that I can
have references to (and collections of) Sub1 and Sub2.  But I'm
worried about the note in the docs which indicates that 'super' and
extents don't cooperate well.  Is it possible to use this arrangement

i haven't tried it for a long time. but the restriction of the uniquness of the pk within the hierarchy still exists. you could try to use antoher field to reference the super class.


and still be able to (1) query against Sup and get a result set
containing Sub1 and Sub2 instances, and (2) use Sup in reference- and
collection-descriptors from other classes?  I'm worried that OJB will
end up instantiating Sup rather than Sub1 or Sub2.  Is this a
concern?

thanks,
-steve

jakob

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



Reply via email to