-->
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 Mapping:For tables which don't have a relation
PostPosted: Fri Aug 14, 2009 8:55 am 
Newbie

Joined: Fri Aug 14, 2009 7:32 am
Posts: 5
Hi All,

I have two tables within same schema which don't have a relationship at all.
Say, it's User(ID,loginName,Pasword,etc..) and Customer(ID,country,etc..).

Here, In order to obtain the loginName, pasword, for a customer who have ID 1 we need to look for user who have the ID 1(In the User table). Currently this is done by means of stored procedures.
In my case, I need check whether the user is a Cutomer when some one logs in (Also needs to get both details of User and Customer if the User actually is a customer).

So my approach is to have a Customer class extending User class so that I have all the details required for the above mentioned requirement.

However the problem I have a neither a discriminator column nor relationship between tables to do the inheritance mapping.

Skimming through the Hibernate documentation, what I understood is this is not possible under Hibernate. Any suggestions to accomplish this , or more smart solutions [this doesn't mean my approach is smart, :) ] than my approach is highly appreciated.

Thanks and Regards,
Knox.


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.