-->
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.  [ 2 posts ] 
Author Message
 Post subject: Mappping Question Existing DB
PostPosted: Thu Jul 05, 2007 9:27 am 
Newbie

Joined: Thu Jul 05, 2007 9:16 am
Posts: 4
Hibernate Version 3.1.3

I have a situation with existing tables. There is a single table called "business" with a primary key generated by sequence.

Then I have types of businesses (8 to be exact) which use "business" tables PK, as a [PK,FK] into their types of tables.

The basis is that there are 8 types of businesses we handle, but only one valid business type exists for each "business". So my original thought was to use a one-to-one but whenever I do get() or list(), it joins the 8 tables. I would rather it not as the 8 tables in the future may expand to more than 8.

I then tried a one-to-many from business, to type of business which does not perform the join (possibly because of proxying) and does the right thing.

I do not feel that this is the best solution, and was hoping someone may give some insight into this. Possibly offer up better design or improvement ideas.

Thanks,


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 05, 2007 10:41 am 
Beginner
Beginner

Joined: Fri May 18, 2007 10:28 am
Posts: 48
Location: Madison, WI
I also have a similar situation.I think it is more dictated by the table structure and the constraints that are associated with it.

_________________
Please rate if it helped


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

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.