| Author |
hibernate, mapping using discriminator - need idea
|
Krishnaa Kumar
Greenhorn
Joined: May 05, 2011
Posts: 25
|
|
I Have a table(student) with columns stu_id, stu_name, favourite_subject, subject_id
favourite_subject will have predefined values like maths,english etc. if the value is maths, subject_id will have table: maths_subject's id.
meaning, based on favourite_subject value, subject_id will be pointing to the corresponding subject's id.
How can i implement in Hibernate ORM Framework.
all subjects will have their own tables & own corresponding entity classes.
|
 |
Vijitha Kumara
Bartender
Joined: Mar 24, 2008
Posts: 3670
|
|
|
Look at the example for discriminator strategy provided for Hibernate here.
|
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
|
 |
 |
|
|
subject: hibernate, mapping using discriminator - need idea
|
|
|