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
|