HibernateConfigurationDesignTab

The Design tab allows the user to visually view and edit the Hibernate configuration file. In the Projects window, right-clicking on the Hibernate configuration file (*.cfg.xml) and select "Open" from the context menu, or double-clicking on the configuration file (*.cfg.xml) brings up the Design tab for the configuration file. The Design tab displays the configuration data hierarchically as following:

- Session Factory
     + JDBC Properties
     + Datasource Properties
     - Optional Properties
          + Configuration Properties
          + JDBC and Connection Properties
          + Cache Properties
          + Transaction Properties
          + Miscellaneous Properties
     + Mappings
     - Cache
          + Class Cache
          + Collection Cache
     - Events                      [Add]
          + post-update            [Remove]
          + post-insert            [Remove]
          + post-delete            [Remove]
          (one node per defined event)
+ Security

Note that the properties are separated into different nodes based on the Configuration chapter in the Hibernate Reference Documentation. All the events are displayed as sub-nodes of the Events node. The name of the sub-nodes are the event type. The user uses the Add button to add a new event type and remove to delete an existing one.

Each leaf node contains a panel for displaying and editing the related data. For example, the JDBC Properties Node contains a panel looking like this (textual version):

               Name                                  Value
   hibernate.connection.driver_class	org.apache.derby.jdbc.ClientDriver
   hibernate.connection.url	        jdbc:derby://localhost:1527/travel
   hibernate.connection.username	travel
   ibernate.connection.password	        travel

           [[Add... | Add...]]  [[Edit... | Edit...]] [Remove...]
  • The Add button brings up a dialog to let the user to add a new JDBC related property
  • The Edit button brings up a dialog to let the user modify an exit property
  • The Remove button removes the selected property.


The panels for the other leaf nodes will work in the similar way.

The modification made in the Design tab will be reflected in the XML file right way. For example, if you add a new JDBC property in the Design tab and then switch to XML tab. You will the newly added property in the XML source. This is also true when you modify the xml source and switch to the Design tab.

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo