Title: EnityBeans with Pk and Fk

      Hi,

      I am having two table emp, dept. Dept is a parent table and emp is a child table with deptno as common field.
      i am having corresponding entity beans
      In the session bean ie controller class,
      If i want to insert records into the database
      I think there r two ways to use the primarykey-foreign key relationship
      1. creating both objects in the session bean and call the appropriate methods
      2. create dept object, i am planning to keep addEmp() method in it, in this method i will create emp object from remote interface and add it.

      I think second one is better in this way, encapsulation ie hiding the information about emp is achieved

plz send ur commets

SaiRamTDG
HCL Technologies Ltd

Reply via email to