IntelliJ IDEA 13.1 Web Help

Some features described here are available in Ultimate edition only.

Once a session factory is created, the next step is to populate it with entities, embeddables, etc. Creating an element in a session factory results in creating the corresponding Java class, entries in the metadata files, and adding a node to the session factory in the Persistence tool window.

You can create Hibernate elements manually, by means of creating annotated Java classes, or use the context menu of the Persistence tool window.

When you use the context menu commands, IntelliJ IDEA takes care of creating classes and members, providing annotations and adding the corresponding entries to the descriptor files.

When you create the Hibernate elements and members manually, it is the developer's responsibility to create the necessary declarations, annotations, and accessor methods. IntelliJ IDEA provides extensive coding assistance in the Java classes and metadata files.

To create a hibernate element using the context menu of the persistence tool window
  1. In the Persistence tool window, right-click the desired session factory, and choose element type from the New context menu.

    hibernateAddElement.png
    Click thumbnail to view larger image.

  2. In the dialog box that opens, specify class name and location, and click OK. For the entity listeners, specify the listener methods to be implemented, and the entity listener bindings.
  3. Further, to add members, right-click the desired element, and choose member type on the context menu.
  4. In the dialog box that opens, specify the member name and type. Where necessary, specify the target metadata files.

Tip

Use 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 to create new elements and members.

See Also

Concepts:

Procedures:

External Links:

Web Resources: