Package org.hibernate.jpa


package org.hibernate.jpa
The packages in this namespace are responsible for implementing certain requirements of the JPA specification, especially things which are only needed when Hibernate is acting as a JPA persistence provider.

This package contains an implementation of a JPA PersistenceProvider. You may choose Hibernate as your JPA persistence provider by including the following line in persistence.xml:

<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
When working with the Hibernate persistence provider, keep in mind that:

Thus, Hibernate's many powerful extensions to the JPA specification are always readily accessible.

The class HibernatePersistenceConfiguration extends PersistenceConfiguration with options specific to Hibernate, as explicitly encouraged by the specification, and is now the preferred way to start Hibernate when operating outside any container environment.

Subpackages define a range of SPIs.

  • The subpackage org.hibernate.jpa.boot.spi contains the SPI of this persistence provider, including an SPI used to bootstrap the JPA provider, and interfaces which may be implemented to contribute extensions during of the bootstrap process.
  • The package org.hibernate.jpa.event implements support for JPA entity lifecycle callback methods and entity listeners.
  • The package org.hibernate.jpa.spi provides an SPI for managing cases where Hibernate intentionally violates the JPA specification by default (something Hibernate only does when it has a really good reason to do so).

Finally, we have two interfaces which enumerate the JPA query hints recognized by Hibernate:

  • SpecHints enumerates the standard hints defined by the JPA specification, and
  • HibernateHints enumerates hints defined by Hibernate.