> Is such behavior correct?
I don't know the O/R-Mapper you use, but: yes, this behavior is what I
would expect.
Furthermore, the O/R-Mapper should return an instance of the subclass,
if the join was successful with either sub table.
Regards
Jens
sveta - 27 Mar 2007 12:08 GMT
> > Is such behavior correct?
>
[quoted text clipped - 5 lines]
> Regards
> Jens
i use EJB 3.0 embedded into JBOSS 4.0.5.
thanks for your opinion,
but to me, other behavior seems natural.
If i had simple Java classes (not mapped to tables), then if i wanted
to get the instance of superclass, i would get exactly what i want and
i will spend same time, not depending what subclasses and how much of
them this class had.
And here i see, that i want to get only three fields of the table Ref
and JBOSS makes query to ALL dependent tables instead, and select ALL
fields of those tables. Though the result is right, the time is
wasting.
Perhaps i'm wrong in my OR-mapping strategy. in reality i need such
structure in which i could get quickly the instances of Ref, and
_sometimes_ much more complicated instances of subclasses (here the
requirements for time are not so strict). and all this complex
instances MUST extend Ref.