Creating JavaBean wrapper access beans
Use the Add an Access Bean wizard to create a JavaBean wrapper access bean.
To create a JavaBean wrapper access bean:
- In the J2EE perspective, select File > New > Access Bean. The Add an Access Bean wizard opens.
- Select the Java bean wrapper radio button, and click Next.
- In the EJB Project field, make sure that the correct name of the EJB project appears that contains the enterprise bean for which you want to create an access bean.
- In the Enterprise Bean field, make sure that the correct name of the enterprise bean appears for which you want to create an access bean, then click Next. Note: Enterprise beans with only a local client view will not appear.
- A wizard page is opened that allows you to specify a home interface method to correspond to the zero argument constructor of the access bean. For instance, if you want to use the zero argument constructor to create a new instance, you should select a create method, but if you want the zero argument constructor to find an existing instance, you should select a findByPrimaryKey method. The home interface method that you select is used to instantiate the enterprise bean when the access bean is instantiated. In the Constructor method field, make sure that the correct home interface method is selected, then click Finish to immediately generate the Java bean wrapper, or click Next.
- Ensure that the check box is selected for each enterprise bean property for which you would like to have copy helper support, then click Finish to generate the new data class or copy helper access bean.
To identify the enterprise bean properties that are selectable for the access bean, the wizard performs introspection of the enterprise bean using the Enterprise JavaBeans specification rules for detecting getter and setter accessors. If either the getter or setter method in the enterprise bean class throws an exception, the property will not be recognized and the wizard will not display it. This is a requirement of the wizard, not an Enterprise JavaBeans requirement.
Parent topic
Creating EJB access beans