Hibernate version: 3.0
Suppose we have three inherited classes:
class A {...};
class B extends A {...};
class C extends B {...};
Classes B and C add few fileds to their parents. They have almost the same hibernate mappings. The difference is that A is mapped only to the fields of a single table T1, class B - adds one-to-one mapping to a T2 table and class C has a list mapped to T1 table through instance of A class.
For example consider that S[i] is an instance of S class innitialized with the i row of T1 table and T1 has two rows 1 and 2
The problem is:
When a call a getAll( Class class ) function or execute query for class A
i.e. getAll( A.getClass() )
the response I get is { A[1], A[2], B[1], B[2], C[1], C[2] },
for the getAll( B.getClass() )
the response is { B[1], B[2], C[1], C[2] }.
But I'd like to get { A[1], A[2] } and { B[1], B[2] } correspondingly. What should I do?
|