If you have two classes defined like so:
Code:
public class FullListing extends Listing {
private int value2;
public void setValue2(int value) { blah, blah }
public int getValue2() { blah, blah }
}
public class Listing {
private int value;
public void setValue(int value) { blah, blah }
public int getValue() { blah, blah }
}
And you have two mapping files, FullListing.hbm.xml and Listing.hbm.xml with BOTH mapping files pointing to the
same table. Can you not do this?
When I try to do something like
Code:
criteria = session.createCriteria(Listing.class);
criteria.list();
I get really goofy results. For some reason, it trys to run the mappings for both the Listing and FullListing classes even though I only specified Listing.class in the createCriteria. I assume it has something to do with the fact that FullListing inherits from Listing. But I would expect only the Listing mapping to get processed, not FullListing.
Has anyone else encountered this and is this expected behavior?