JPA/Configuration file

This component is meant to generate the persistence.xml configuration file. This is done by the following Component :

Please be aware that in this version, we only support Hibernate implementation of the JPA API, so both in the component and in the resulting file, we use Hibernate specific parameters and syntax. You can expect the next versions to support other JPA implementations, such as TopLink.

As shown in the component snapshot, you can visually configure thes options :

  • Persistence unit : the name of the persistence unit.
  • Driver class : the fully qualified name of the database JDBC compatible driver.
  • Connection url : the database URL.
  • Dialect : the database dialect (specific to Hibernate)
  • User name : the login for the database access.
  • Password : the password for the database access.
  • hbm2ddl mode : specific to Hibernate.
  • Show SQL : to show/hide the executed SQL requests.
  • Format SQL : whether to format the generated SQL requests or not.
  • Show SQL comments : whether to add comments to the generated SQL or not.

Please note that the generated file is named persistence.xml and will be located in the src/META-INF directory.

You can click on Preview button to preview generated code :

Click on the Finish button to generate the persistence.xml file.