Hi,
I have a table employee as follows:
emp_id PK, name, title_id FK
and a title table as follows:
title_id, name
So I have an Employee class to map to the employee table and Title to the title table. Now I also what a subclass A, that has title_id of 1, but I still want Employee to carry title_id as well.
Basically, I need to map title_id into Employee.titleId, but all records of title_id of 1 should be Interviewers (not necessarily setting Interviewer.titleId). How would I do this? The table-per-hierarchy strategy works if I use insert=false and update=false on my <many-to-one> mapping of Title, but I definitely need to update this column in my database. If I don't use those two attributes it gives a "column mapped twice" error and suggests the insert=false update=false solution.
Hibernate version: 3.0.4
Name and version of the database you are using: Postgres 7.4
|