-->
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: How to map single object to multiple-tables ?
PostPosted: Thu Feb 24, 2005 2:52 pm 
Newbie

Joined: Thu Feb 24, 2005 2:41 pm
Posts: 3
Hibernate version:3.0

Name and version of the database you are using:PostgreSQL 8.0

My question is:

How can i map in hibernate 3.0 beta4 one single value object into 3 tables with same columns as in value object properties.

example:

value object: Document
properties: id, type, Collection of values

tables: Policy, Note, News
columns: id, type

"type" means as dicriminator, where is data persited.
When type = "Po" i want to persist value object into table Policy and so on with others types ("No", "Ne" ).

Reason of this using is large amount of data for one table !

Plz help me, how ... thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 25, 2005 2:41 am 
Regular
Regular

Joined: Thu Dec 18, 2003 2:14 am
Posts: 103
Location: Brooklyn, NY
I would recommend against this. Pick smaller classes, and aggregate them with one-to-one relationships.

"One big entity" is a bad design, in my opinion. If the data is "too large" for a single database table, its too complex for a well-designed class.

Also, take a look at those tables. Make sure you are not just "breaking out" data, but actually making meaningful groupings. This will make your class design much easier.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 25, 2005 2:43 am 
Regular
Regular

Joined: Thu Dec 18, 2003 2:14 am
Posts: 103
Location: Brooklyn, NY
I believe I may have misunderstood. You may just need to use subclasses.

http://www.hibernate.org/hib_docs/v3/re ... n-subclass


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.