This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
You have a table that has a foreign key to a "lookup" table. Say for instance Order Status. So in the Order Header table you have the Foreign Key to the Order status. Now on the client side the user wants to select a nice pretty String representation of the status, but you want to save the PK of that record in the Order Header Table.
A) Put both the ID field and the String into the POJO representing the Order Header. ----1) Would the client just put in the String and allow Hibernate to find the FK? ----2) Or would the client be required to put in the FK? B) Keep just the ID field and the client has to do a lookup to the database?