-->
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.  [ 1 post ] 
Author Message
 Post subject: Mapping help
PostPosted: Tue Aug 29, 2006 4:37 pm 
Newbie

Joined: Fri Aug 04, 2006 6:09 am
Posts: 18
Hi,

i'm new to Hibernate but not Java or Databases (Oracle).

I have a table called COUNTRY and that maps to a POJO called Country. I have a table called OFFICE which contains a foreign key column to COUNTRY.

I'm not sure how to map the foreign key column. I see a few possibilities:

1. Declare the column to be of type Country.
2. Declare a many-to-one mapping.
3. Declare a string field to hold the foreign key value.

If it helps, the use case is to display the rows of data for offices in a web page showing the country id and have a pop-up next to it which has a list of all countries for selection.

The examples I have seen do not make it clear when to map as above. Any help appreciated.

Thanks

R


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.