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.  [ 3 posts ] 
Author Message
 Post subject: mapping style/db design debate in need of opinion
PostPosted: Tue Jul 18, 2006 1:25 pm 
Newbie

Joined: Tue Jul 18, 2006 1:17 pm
Posts: 8
Good afternoon.

As the project I'm working on has grown, one of the domain objects is growning a bit large for some folks taste (70 fields). This of course translates to 70 columns in the DB.

We're having a debate over how to manage this... The attributes all clearly belong to the entity in question, so I content they all belong in one table, and we should use components to compose the entity, making it more manageable while not disrupting the db structure.

Others contend that we ought to break the table into multiple smaller tables and join them with 1-1 relationships.

I see the second strategy as causing issues with uneeded joins, issues when constructing queries, etc.

I'm looking for opinions from the community to help settle this debate. Any input is greatly appreciated.

Thanks


Hibernate version: 3

Name and version of the database you are using:MySQL 4


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 18, 2006 7:46 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
I concur with you. Joins are not as efficient as single selects, and hibernate (and other ORMs) handle components nicely. If you add in dynamic-update to the class, you'll also end up with much smaller update statements; with the one-to-one approach, you'll end up updating each joined table, whether they need it or not. That's (to quote Wally from Dilbert) bleah.

_________________
Code tags are your friend. Know them and use them.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 18, 2006 10:07 pm 
Newbie

Joined: Tue Jul 18, 2006 1:17 pm
Posts: 8
I appreciate the reply (moreso I think because you agree with me :) )

I had a lot of reasons lined up, but the update case wasn't one of them, so I appreciate that angle - I'll add it to the arsenal.

Thanks for your time.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.