Hi,
I am new to Hibernate and I am facing some trouble making table-per-class-hierarchy work.
The problem: I have a abstract base class by name Person (mapped to table PERSON in the database) and 2 concrete extensions to Person with names, Employee and Student. There are no properties specific to either of these subclasses. I want the database field called PROFESSION to be used as a discriminator to instantiate either Employee or Student.
When I try to do this, the query on the abstract base class, "from Person" is always returning all the objects with type corresponding to the first discriminator value found in the database.
Please advise.
Thank you
prakashn
|