-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Inheritance Problem
PostPosted: Thu Jul 15, 2010 4:02 am 
Newbie

Joined: Sat Dec 03, 2005 7:03 am
Posts: 3
Hi,

I'm looking for a solution for following solution:

1. A class AppUser is inherits from BaseUser:
Code:
pubic class BaseUser{
   private Long id;
   private username;
   private passwort;
   // [...]
   // setter and getter
}
pubic class AppUser extends BaseUser{
   private email;
   private company;
   // [...]
   // setter and getter
}

2. It must be possible to load both Objects.
Code:
BaseUser baseUser= (BaseUser )session.load(BaseUser .class, id1);
AppUser appUser = (AppUser )session.load(AppUser .class, id1);

Data witch are stored as AppUser can be loaded as BaseUser !!!

3. The data of both Entities are stored in one DB table:
==================================
| id | username | passwort | email | company |
==================================

4. Configuration via Annotations

Any Ideas ?
Regards
Kai


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.