-->
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: Two Entities for the Same Table?
PostPosted: Mon Mar 15, 2010 5:42 pm 
Newbie

Joined: Thu Nov 27, 2008 11:05 pm
Posts: 9
Is there anything wrong with having two entities for the same table? I currently have a table with 300+ columns. I also have a search engine that only needs about 10 of these fields. I thought of creating a view in the database, but need to be able to fetch one-to-many associations (open session in view pattern) on occassion. I created an entity with only 10 columns (plus all the many to many and one-to-many associations) referencing the same 300 column table. This didn't seem to "break" anything so I am assuming this is okay? Is there anything wrong with this approach? Is there a better way? Many thanks.


Top
 Profile  
 
 Post subject: Re: Two Entities for the Same Table?
PostPosted: Tue Mar 16, 2010 2:56 am 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
I think it should be okay. I have done a similar thing myself and use the partial mapping for reading only. I guess it should be fine to update the 10 columns as well without affecting the other 290+.


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.