Use the EJB deployment descriptor editor to specify the relationship between two enterprise beans in your EJB project or module. The EJB deployment descriptor editor generates the appropriate finder methods to support any relationships that you create.
When you define a relationship from one CMP to another, extra CMP fields based on the key fields from the referencing CMP bean are added to the owning CMP bean of the forward referencing role (Foreign Key check box is selected on the owning CMP bean).
For example, Company has a 1..N relationship to Employee with roles company and employees respectively. The company role is forward and the Company CMP bean has key fields named "companyID" and "companyName." The CMP fields that are automatically added to the Employee bean are "company_companyID" and "company_companyName." These fields are hidden in the EJB editor because they are fields that were added to support the "employee" relationship role. Problems would arise if these CMP fields were removed from the ejb-jar.xml file while the relationship still existed.
To create a relationship between two enterprise beans (CMP 1.x ):