Using Hibero

XML Configuration/Mapping

The features related to XML configuration/mapping (auto-completion, find usages, refactorings, inspections, etc.) are enabled without any extra configuration. The only piece of information necessary is the version of Hibernate you are developping against.
The targetted Hibernate version is specified at the Hibernate Configuration Profile, and version 3.1.x (or above) will be assumed if no profile is selected.

Please note that an XML file will be recognised as a Hibernate mapping file by its DTD:

  • Hibernate 3.x: http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd
  • Hibernate 2.x: http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd

And for XML configuration files:

  • Hibernate 3.x: http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd
  • Hibernate 2.x: http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd

Also, be sure that these DTD files are defined in IDEA's resources settings (File | Settings | Resources).

For your convenience Hibero provides templates to quickly create Hibernate XML Configuration and Mapping files accesible from the New contextual menu.

New Hibernate XML Files

EJB3 Persistence Annotations

To enable the features related to EJB3 Persistence Annotations just be sure that the annotations (@javax.persistence.*) are included in the project classpath.
The Hibernate Annotations distribution includes an implementation of such annotations in its directory lib/ejb3-persistence.jar.

Hibernate Annotations

To enable the features related to Hibernate Annotations include both hibernate-annotations.jar and lib/ejb3-persistence.jar from the Hibernate Annotations distribution to the project classpath.

Database and HQL

The completion of database objects and HQL features like query execution, translation, etc. require:

  1. A Hibernate Configuration Profile properly configured.
  2. All required libraries to create the Hibernate runtime environment that depending on your chosen profile it may be just Hibernate Core and JDBC driver or also Spring, Hibernate Annotations, Hibernate Entity Manager and EJB3 Persistence.
  3. A valid output path where to find the compiled POJO classes.