Creating CMP entity beans from an imported data source Click OK when you are done with the Edit Table Reference editor to return to the new field s inspector. You can use this inspector to specify if the relationship is one to one, one to many, or many to many. You can also specify whether the relationship is unidirectional or bidirectional. If you select bidirectional, a new field also appears in the second bean. For example, if you have an Employee entity bean and a Project entity bean, you might want to create a relationship that allows an employee to have multiple projects as well as keeping track of all the employees on a single project. In this case, the direction of the relationship is bidirectional. Therefore, the Employee bean will have a new field named project, and the Project bean will have a new field named employee. If you want the related rows in the other table in a relationship to be deleted when the first row of a table is deleted, set the Cascade Delete field to true. For example, a customer may shop in an online store and create an order, so there may be a Customer table and an Order table. If the Customer table has a relationship with the Order table through its order field and the Cascade Delete field is true, when the customer is deleted, all orders made by that customer are deleted also. The Cascade Delete field can be set for one to one or one to many relationships only. Use the CMR Field Properties in the inspector to specify in which interface(s) the getter and setter access methods are declared. The Return Type field value is the return type of the getter method and the type of the parameter passed to the field s setter method. Specifying a WebLogic relationship To specify how the relationship is to be created, click the new field that has been added to the bean you began specifying the relationship from. A relationship inspector appears: Specify whether the relationship will be one to one, one to many, or many to many using the Multiplicity field. You can also specify whether the relationship is unidirectional or bidirectional. If you select bidirectional, a new field also appears in the second bean. For example, if you have an Employee entity bean and a Project entity bean, you might want to create a relationship that allows an employee to have multiple projects as well as keeping track of all the employees on a single project. In this case, the direction of the relationship is bidirectional. Therefore, the Employee bean will have a new field named project, and the Project bean will have a new field named employee. If you want the related rows in the other table in a relationship to be deleted when the first table is deleted, set the Cascade Delete field to true. For example, a project has employees. If the Project table has a relationship with the Employee table through its employee field and the Cascade Delete field is true, when the project is deleted, all employees on that project are deleted also. The Cascade Delete field can be set for one to one or one to many relationships only. Use the CMR Field Properties in the inspector to specify in which interface(s) the getter and setter access methods are declared. The value of the Return Type field is the Chapter 6: Creating entity beans with the EJB designer 55
Our facility is located in Orlando, Florida. Our Orlando web hosting data center gives you assurance that your website will work smoothly . Check more in Orlando Web Hosting.