• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate : Index in parent table

 
Amit kull
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My Code:


Query: We don't have creditcard.hbm.xml but we have person.hbm.xml
Person index is generated in person table. But creditcard index is generated in employee table.

Ruled out alternatives: Make the association one-to-one´┐Ż.
Make the association bi-directional´┐Ż
Also we would prefer using discriminator.
Is there a way the problem could be solved so that credit card index gets generated in credit card table?
Thans. And sorry for a lengthy question.
[ August 04, 2008: Message edited by: Amit kull ]
 
Amit kull
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So the effective query is:
I want to create tables where subclass table's primary key is same as that of main table- ID (auto increment)
Also the main table will have one TYPE coulmn where the type will be same as the subclass table's name.

Please ignore case (small/capital) related errors, if any in tha attached code above.
Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic