-->
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: Complex mapping advice requested.
PostPosted: Wed Nov 22, 2006 5:31 am 
Newbie

Joined: Wed Jun 28, 2006 5:06 am
Posts: 4
Location: The Netherlands
I have a problem mapping the following in Hibernate 3.1.3.

We have 1 user table. This table has a relation to 1 of 3 tables to create a join with another of 3 tables and to determine the type (spare me I didn't come up with that solution :) ).

Currently to retrieve a user we chech the 3 tables to see in which of the tables the user is present and retrieve the record from the desired table. Which isn't a big problem for retrieving 1 user, but when retrieving 100s of records it is a problem.

Schematic representation
Code:

              /      employee type 1 join table --- employee type1 data table
[USER]------    employee type 2 join table --- employee type2 data table
              \      employee type 3 join table --- employee type3 data table



Currently I'm trying to find a solution to place this in the mapping. However I seem not be able to come up with a solution which is managable by Hibernate.

I would like to create a view from all the tables, containing the userId and employee type, and then use the employee type as the discriminator to retrieve the correct employee. However I seem not to be able to specify a select different from the mapping.

Any suggestions would be helpful.


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.