Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

head start needed in designing hibernate application

 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi group,

I have just started to learn hibernate.

i have a two classes called User and contact; both classed extends to BaseObjectModel;

I have a id field in the BaseObjectModel class. That "id" i want to use in both subclasses.

What inheritance strategy i should use and how to implement that strategy in the mapping files.
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No inheritence strategy.

Just a class that is inheriting the other class to get the parents classes attributes. It has nothing to do with mapping inheritence in this case.

Mark
 
vijay shanker
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Mark Spritzler wrote:No inheritence strategy.

Just a class that is inheriting the other class to get the parents classes attributes. It has nothing to do with mapping inheritence in this case.

Mark



It is what i am doing but. i get a problem when loading details from data base--- ID, that is in parent class, left null by the returning object. And it gives assertion fail error in hibernate library.
 
I am not a spy. Definitely. Definitely not a spy. Not me. No way. But this tiny ad ...
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic