Hi,
I'm wondering if what I'm trying to do is meant to work or not, and if not, what the best approach is.
The basic situation is as follows:
An abstract class (Call this C)
Two concrete classes (A and B)
Classes A and B map to separate tables in the DB (tblA and tblB)
Both A and B have a property x which maps to columns tblA.y and tblB.z (i.e. same property name mapped to different columns)
Now is it possible to create a query as follows:
Code:
session.createCriteria(C.class)
.add(Restrictions.like("x", "value"))
.list();
Whereby the result will return me a list of concrete classes (
A and
B) where their
x property matches
"value".
Hopefully that makes sense as to what I'm trying to achieve.
Is this the correct approach?
Many thanks
Paul