-->
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: Seeking mapping strategy suggestions
PostPosted: Fri Aug 13, 2004 12:56 pm 
Newbie

Joined: Fri Aug 13, 2004 12:17 pm
Posts: 12
Location: St. Louis, MO
Hibernate version: 2.1.5

Name and version of the database you are using: Oracle 9i

I am adapting a legacy system where I have a flight record represented by two tables as such:

Code:
table a
--------
record serial number (pk)
date_scheduled
city 1

table b
--------
record serial number (fk)
record sequence number
city 2
weight

record serial number & record sequence number are the pk of this table


As an example you can have
Code:
Serial   Seq   City1  City2  Weight
ABC1      1     MCI    ANC    500
ABC1      2     MCI    CHI    300


I am unsure on what the best method for mapping this is....should I have one POJO to represent the record and have hibernate represent it across two tables or should I have two POJO's with a MANY-TO-ONE relationship? Are there other options that might be better?

Thanks for your time,

Ryan


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 17, 2004 9:09 am 
Beginner
Beginner

Joined: Mon Aug 09, 2004 12:31 pm
Posts: 47
Location: New York, NY, USA
Conceptually, you have two tables -> two POJOs. There is a clear one-to-many (or many-to-one) mapping.

That's just my opnion though.

_________________
--DP


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.