-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Mapping/inheritance question
PostPosted: Thu Jun 23, 2005 4:33 pm 
Beginner
Beginner

Joined: Tue Jan 06, 2004 4:51 pm
Posts: 48
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.