jpa的配置文件,persistence.xml

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="
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 http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd ">
 <persistence-unit name="jpa-1" transaction-type="RESOURCE_LOCAL">
  <!-- 配置使用什么ORM产品实现JPA -->
   <provider>org.hibernate.ejb.HibernatePersistence</provider>
   <class>Customer</class>
  <properties>
  
   <!-- 链接数据库的基本信息 -->
   <property name="javax.persistence.jdbc.user" value="root"/>
   <property name="javax.persistence.jdbc.password" value="123"/>
   <property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
   <property name="javax.persistence.jdbc.url" value="jdbc:mysql:///jpa"/>
   
   <!--配置hibernate的基本属性  -->
   <property name="hibernate.format_sql" value="true"/>
   <property name="hibernate.show_sql" value="true"/>
   <property name="hibernate.hbm2ddl.auto" value="create"/>
  </properties>
 </persistence-unit>
</persistence>



你可能感兴趣的:(jpa的配置文件,persistence.xml)