- Open the deployment descriptor file ejb-jar.xml for editing.
- In the entity section for the corresponding entity bean, type the tags for CMP fields, and specify their names.
- Open the source code of the desired entity bean class for editing. The code inspection detects missing
- Press Alt+EnterAlt+Enter to reveal the list of suggested quick fixes:
- Create getter and setter methods in the bean implementation class.
- If you want to make the new CMP field a primary key, add the <primkey-field> entry to the deployment descriptor.
- In the EJB tool window, right-click the desired entity bean.
- On the context menu, click
Alternatively, open the desired bean for editing, and in the CMP Fields section click ., and then choose
on the submenu.
- In the Create CMP Field dialog box, specify the following parameters:
- Field name, optional description and type. You can choose the desired type from the drop-down list, or click the ellipsis button and select type from the Choose CMP Field Class dialog box.
- Whether the new CMP field will be a primary key. Select the Primary key check box, if you want to make this field a primary key.
- Whether the accessor methods will be generated in the local and remote interfaces. If you select the corresponding check boxes, the getter and setter methods will be created in the local and remote interfaces, in addition to the bean class.
- Click OK.