-->
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.  [ 4 posts ] 
Author Message
 Post subject: Storing multiple objects to one table
PostPosted: Fri Apr 30, 2004 6:37 am 
Newbie

Joined: Fri Apr 30, 2004 6:24 am
Posts: 4
Location: Mumbai, India
I am currently doing some R&D on Hibernate and intend to use it. But my database table schema is very old and cannot be changed. It's an Informix one and I am using Hibernate 2.1.3.
I have to insert data into one table which would be coming from many unrelated objects which may or may not be composite. Composition has been extensively used in the object model.
How would the configuration look like for a table which stores data coming from multiple objects ??


Please advise,
flexian


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 30, 2004 1:35 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
like a chram.
See <component in documentation

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 03, 2004 1:16 am 
Newbie

Joined: Fri Apr 30, 2004 6:24 am
Posts: 4
Location: Mumbai, India
The component section in the Hibernate documentation does not say anything about mapping "unrelated" classes. In our system here's the scenario.

There is one table table1 which stores data from two absolutely unrelated objects obj1 & obj2.
obj1 holds data such as a newly created userid and username while obj2 holds the users online application data.
table1 stores data from both these objects.

How do I address this scenario ??
Again, change to object model and db schema is not possible.

Please advise,
flexian


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 03, 2004 8:24 am 
Beginner
Beginner

Joined: Wed Feb 04, 2004 5:21 pm
Posts: 37
It sounds like subclass is the way to go. I assume that you can discriminate between obj1 and obj2 based on values in the record.


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