Use the Add an Access Bean wizard to create a copy helper access
bean.
To create a copy helper access bean:
- In the J2EE perspective, select .
The Add an Access Bean wizard opens.
- Select the Copy helper 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 that only have a local client view will not display.
- 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 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, and 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 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.