• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Hibernate map two classes to same table with each having differnt set of columns.

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I tried to look up this issue a lot but was unsuccessful. Let me put my problem through the following case,


I have a Table table1 With Columns column1, clolumn2, column3,......, column12.

In my application I want to create two classes Class1 to Class2 .


In class1 I want to map columns from column1 to column6 and in class2 I want to map columns from column7 to column12. No column will overlap in two classes. When ever I make instance of the model class I will make only of one and the columns in the other class should be accessible from there (Inheritance may be the solution for this).

Is this possible using hibernate?

The idea behind this whole thought process is that there are some core columns that are mandatory for the application and should not be touched. Where as some columns can be modified as part of end user enhancements. I want to keep those columns that are core to the application separate?

Thanks in advance
Paddy
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic