Consider the class hierarchy here...
Code:
public abstract class MyBase
{
protected String name;
// with getters and setters and other stuff
}
public class Person extends MyBase
{
protected Long personId;
protected Integer age;
// with getters and setters
}
public class Pet extends MyBase
{
protected Long petId;
protected String species;
// with getters and setters
}
Is it possible in Hibernate (3.0+) to setup mappings for the Person and Pet classes that include columns for 'name'? In other words, can I map a class to a table and have that table include columns for all the base class properties (i.e. 'name' in this example)?
I would like to make all of my datamodel classes extend from a BaseDataModelObject class and implement a bunch of common methods in that class. I don't want to map that class to a table. I just want any properties of that class to get mapped into the tables for each concrete class.