I'm completely stuck, and would appreciate any insight on this.  Any
takers?

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
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.

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.

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
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
-- 
Steve Clark
Technology Applications Team
Natural Resources Research Center/USGS
[EMAIL PROTECTED]
(970)226-9291

---------------------------------------------------------------------
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]

Reply via email to