• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
Bartenders:
  • Himai Minh
  • Carey Brown
  • Frits Walraven

Hibernate : Index in parent table

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Do you want ants? Because that's how you get ants. And a tiny ads:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic