Use the Add an Access Bean wizard to create a data class access
bean.
To create a data class access bean:
- In the J2EE perspective, select .
The Add an Access Bean wizard opens.
- Select the Data class radio button, then
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, then 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, and click Next. A wizard page is opened
that allows you to choose enterprise bean properties for which you want copy
helper support.
- Make sure that the check box is selected for each enterprise bean
property for which you would like to have copy helper support, and 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.