IntelliJ IDEA 13.1 Web Help

Some features described here are available in Ultimate edition only.

When a persistent field is added to an entity, the respective annotated properties are added to the source file of the entity class, the field is marked with a gutter icon in the editor, and the member nodes are added to the session factory node in the Persistence tool window , and to the ER diagram of the session factory.

Fields can be created in one of the following ways:

To create fields in the source code
  1. Open the desired entity class for editing.
  2. Type the desired field declaration:

    jpaNewField1.png

  3. Create getter and setter methods. To do that, press Alt+InsertAlt+InsertAlt+InsertAlt+InsertAlt+InsertAlt+InsertCtrl+N or Alt+InsertAlt+InsertAlt+InsertCommand N or Control EnterControl N or Control EnterCommand N or Control Enter, and select Getter and Setter from the suggestion list:

    jpaNewField2.png

  4. Annotate the field. If the required import is missing, use the suggested quick fix:

    jpaNewField3.png

To create persistence fields using the entity context menu
  1. In the Persistence tool window, expand the Hibernate Facets node, and select the desired session factory.
  2. Under the session factory node, right-click Hibernate element you want to populate with fields, and choose New | <field > :

    hibernateAddField1.png

    Tip

    You can invoke the same command on the context menu of an entity in the ER diagram:

    hibernateAddField.png

  3. In the dialog box that opens, specify the field name and type, and click OK.

See Also

Procedures:

Reference:

Web Resources: