Create CMP bean fields
CMP fields are used to provide persistence of the entity beans. Being created, a CMP field appears in the deployment descriptor, and its accessor methods are added to the entity bean classes. In doing so, IntelliJ IDEA provides gutter icons in the editor that help you jump from a CMP field declaration in the deployment descriptor to the accessor methods in the bean class, and vice versa:
IntelliJ IDEA enables you to create CMP fields in several ways:
Using the context menu of an entity bean.
Using the bean editor.
To create a CMP field by editing the source code
Open the deployment descriptor file ejb-jar.xml for editing.
entitysection 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 accessor methods:
Press Alt+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.