-->
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: Multiple tables to one class mapping possible?
PostPosted: Mon Jul 28, 2008 5:17 pm 
Newbie

Joined: Fri Nov 16, 2007 6:20 pm
Posts: 15
I have a situation where I would like to have a single entity (Site) that potentially draws from up to three different tables. Lame I know, but it is what I've got to work with.

We have a Sites table that is maintained by a State entity and I can't modify it. However the application I'm working on requires this data and needs to be able to add sites. Unfortunately at this time I can't just add data to this table and as such I need my own sites table.

I also need to be able to allow the user to search both sets of data and present results as if they were all one.

What is the "best" way to approach this? A wrapper entity that has several properties in it referring to each table/type? Or is there a way to aggregate these tables into one collection?

I was also thinking sub-class, but I was sure how to go about this. All the sites(regardless of which table) have common data, but there are also differences.


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.