I have an inheritance hierarchy in which the superclass abstracts
out of the subclasses the foreign key relationships in a many-to-one
mapping. The inheritance hierarchy is set up using a joined
subclass arrangement, one table per subclass and one for the
super class.
EG:
class A { String pKey; String CFKey; } // Table A
class B extends class A { ... } // Joined subclass B in Table B
class C { pKey; collection of B; } // Table C
When I try to retrieve an instance of C that has a
B, Hibernate generates SQL that refers to CFKey as if
it was in Table B, not in Table A.
Is there any way to get Hibernate to generate SQL that
states:
select * from B where C.pKey == A.CFKey and A.pKey == B.pKey ?
Currently the sql is something like:
select * from B where C.pKey == B.CFKey !!! column not found
Thanks
_________________ John Goyer
|