Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Properties reference for hibernate in persistence.xml

Tags:

Does anyone know a link, post, book or something else where are explained and nominalized all properties that you need and can use in persistence.xml file?

like image 320
artaxerxe Avatar asked Nov 30 '11 10:11

artaxerxe


People also ask

Which of the following properties are configured in persistence xml in JPA?

The properties element allows you to define JPA or JPA provider-specific properties to configure: the Hibernate Dialect. the JTA transaction platform (e.g., GlassFish, JBoss, Bitronix, Atomikos) whether the database schema should be auto-generated.

What is persistence xml Hibernate?

xml File. This file is used to override the default Hibernate settings and to add support for database types that are not out of the box (OOB database types are Oracle Server, Microsoft SQL Server, and MySQL).

What are the elements in persistence xml?

<mapping-file> element: specifies one or more object-relational mapping XML files ( orm. xml files). <jar-file> element: specifies one or more JAR files that will be searched for classes. <class> element: specifies an explicit list of classes.

Where should I put the persistence xml?

xml should be put in the EJB JAR's META-INF directory. If you package the persistence unit as a set of classes in a WAR file, persistence. xml should be located in the WAR file's WEB-INF/classes/META-INF directory.


2 Answers

The JPA 2.0 supported properties (javax.persistence.*) can be found in JPA 2.0 specification.

Vendor-specific properties can be found in appropriate vendor documentation:

  • Hibernate properties (hibernate.*)
  • EclipseLink properties (eclipselink.*)
like image 157
Piotr Nowicki Avatar answered Oct 28 '22 22:10

Piotr Nowicki


Full list of properties, that hibernate uses, you can find in class

org\hibernate\cfg\Environment.java 

in Hibernate distribution.

Javadoc here

like image 31
Ilya Avatar answered Oct 29 '22 00:10

Ilya