-->
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.  [ 2 posts ] 
Author Message
 Post subject: mapping 1 db table to multiple classes
PostPosted: Wed Jun 23, 2004 8:58 pm 
Newbie

Joined: Wed Jun 23, 2004 8:51 pm
Posts: 16
I've never used hibernate, but would like to.
I've got an existing database that I'd like to use hibernate on.
Can I map multiple classes to one table.
My one table has a "type" column which determines which type or class of object it is.
The "type" column can be 1,2,3,4 or 5
So I want to have 5 java classes that all map to this table.
If this is possible, can anyone point me to the doco that tells about this?


Am I allowed to ask this type of question here?
Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 24, 2004 2:17 am 
Newbie

Joined: Tue Feb 24, 2004 8:08 am
Posts: 4
is it a class hierarchy ?

if yes, then it is "table per class hierarchy" inheritance aproach and your "type" column is the discriminator.

if no, then it will not work.


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

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.