<?xml version= "1.0" encoding= "UTF-8"?> <persistence version= "1.0" xmlns:persistence= "http://java.sun.com/ Xml/ns/persistence "xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance "xsi:schemalocation="/HTTP/ Java.sun.com/xml/ns/persistence persistence_1_0.xsd "> <!--the name attribute is used to define the name of the persisted unit (name required, null value is also valid); TRANSACTION-TYPE Specifies the transaction type (optional)-<persistence-unit name= "Unitname" transaction-type= "JTA" > <!--description information. (optional)--<description> </description> <!--an implementation class for Javax.persistence.PersistenceProvider interface (optional)- <provider> </provider> <!--Jta-data-source and Non-jta-data-source are used to specify the Jta and/or non-used by the persistence provider, respectively JTA Global Jndi Name of the data source (optional)-<jta-data-source>java:/MySqlDS</jta-data-source> <NON-JTA-DATA-SOURCE&G T </non-jta-data-source> <!--Declare where Orm.xml is located. (optional)-<mapping-file>product.xml</mapping-file> <!--to the relative of the jar file containing the Persistence.xmlPath to add additional jar files. (optional)--<jar-file> /lib/model.jar</jar-file> <!--explicitly lists entity classes that should be explicitly listed in the Java SE environment. (optional)-<class>com.domain.User</class> <class>com.domain.Product</class> <!-- Declares whether the scan jar file is annotated with the @enity class added to the context. If you do not scan, the following: (optional)-<exclude-unlisted-classes/> <!--vendor-specific properties (optional)--&G T <properties> <!--hibernate.hbm2ddl.auto= create-drop/create/update--<property name= "Hiber Nate.hbm2ddl.auto "value=" Update "/> <property name=" Hibernate.show_sql "value=" true "/> </properties > </persistence-unit> </persistence>
JPA configuration file persistence.xml parameter details