This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have two entity beans: PlayerBean and TeamBean. the realtionship between these beans is : one to many (many players to one team). I am using CMP 2.0 model and the relationship is bidirectional. the fields of Team table in the database are : teamname, teamcity the fields of Player table in the database are: pid, pname, psalary, pteam (pteam is a string and it serves as a FK). in the PlayerLocal interface I wrote : All the codes are inspired from Mastering EJB
in the PlayerBean I wrote:
using J2EE RI, I don't persist the pteam.. are there any things wrong with this design ? if there is a better way to perform this relationship please tell me. if I wrote in my client: player.setTeam(teamloca); will the container fills the pteam field in the Player table with the right value ?