JPA persistence.xml 配置 provider不同实现

JPA persistence.xml 配置 provider不同实现<persistence 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 persist…

  1. <persistence xmlns=“http://java.sun.com/xml/ns/persistence” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”  
  2.              xsi:schemaLocation=“http://java.sun.com/xml/ns/persistence persistence_1_0.xsd” version=“1.0”>  
  3.     <persistence-unit name=“eclipselink” transaction-type=“RESOURCE_LOCAL”>  
  4.         <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>  
  5.         <class>org.compass.gps.device.jpa.model.Simple</class>  
  6.         <class>org.compass.gps.device.jpa.model.SimpleBase</class>  
  7.         <class>org.compass.gps.device.jpa.model.SimpleExtend</class>  
  8.         <exclude-unlisted-classes>false</exclude-unlisted-classes>  
  9.         <properties>  
  10.             <property name=“eclipselink.jdbc.driver” value=“org.hsqldb.jdbcDriver”/>  
  11.             <property name=“eclipselink.jdbc.url” value=“jdbc:hsqldb:mem:test”/>  
  12.             <property name=“eclipselink.jdbc.user” value=“sa”/>  
  13.             <property name=“eclipselink.jdbc.password” value=“”/>  
  14.             <property name=“eclipselink.target-database”  
  15.                       value=“org.eclipse.persistence.platform.database.HSQLPlatform”/>  
  16.             <property name=“eclipselink.logging.level” value=“OFF”/>  
  17.             <property name=“eclipselink.orm.throw.exceptions” value=“true”/>  
  18.   
  19.             <property name=“eclipselink.ddl-generation” value=“drop-and-create-tables”/>  
  20.             <property name=“eclipselink.ddl-generation.output-mode” value=“database”/>  
  21.   
  22.         </properties>  
  23.     </persistence-unit>  
  24.     <persistence-unit name=“embeddedeclipselink” transaction-type=“RESOURCE_LOCAL”>  
  25.         <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>  
  26.         <class>org.compass.gps.device.jpa.model.Simple</class>  
  27.         <class>org.compass.gps.device.jpa.model.SimpleBase</class>  
  28.         <class>org.compass.gps.device.jpa.model.SimpleExtend</class>  
  29.         <exclude-unlisted-classes>false</exclude-unlisted-classes>  
  30.         <properties>  
  31.             <property name=“eclipselink.jdbc.driver” value=“org.hsqldb.jdbcDriver”/>  
  32.             <property name=“eclipselink.jdbc.url” value=“jdbc:hsqldb:mem:test”/>  
  33.             <property name=“eclipselink.jdbc.user” value=“sa”/>  
  34.             <property name=“eclipselink.jdbc.password” value=“”/>  
  35.             <property name=“eclipselink.target-database”  
  36.                       value=“org.eclipse.persistence.platform.database.HSQLPlatform”/>  
  37.             <property name=“eclipselink.logging.level” value=“OFF”/>  
  38.             <property name=“eclipselink.orm.throw.exceptions” value=“true”/>  
  39.   
  40.             <property name=“eclipselink.ddl-generation” value=“drop-and-create-tables”/>  
  41.             <property name=“eclipselink.ddl-generation.output-mode” value=“database”/>  
  42.   
  43.             <property name=“eclipselink.session.customizer”  
  44.                       value=“org.compass.gps.device.jpa.embedded.eclipselink.CompassSessionCustomizer”/>  
  45.   
  46.             <property name=“compass.engine.connection” value=“target/test-index”/>  
  47.             <property name=“compass.debug” value=“true” />  
  48.         </properties>  
  49.     </persistence-unit>  
  50.     <persistence-unit name=“toplink” transaction-type=“RESOURCE_LOCAL”>  
  51.         <provider>oracle.toplink.essentials.PersistenceProvider</provider>  
  52.         <class>org.compass.gps.device.jpa.model.Simple</class>  
  53.         <class>org.compass.gps.device.jpa.model.SimpleBase</class>  
  54.         <class>org.compass.gps.device.jpa.model.SimpleExtend</class>  
  55.         <exclude-unlisted-classes>false</exclude-unlisted-classes>  
  56.         <properties>  
  57.             <property name=“toplink.jdbc.driver” value=“org.hsqldb.jdbcDriver”/>  
  58.             <property name=“toplink.jdbc.url” value=“jdbc:hsqldb:mem:test”/>  
  59.             <property name=“toplink.jdbc.user” value=“sa”/>  
  60.             <property name=“toplink.jdbc.password” value=“”/>  
  61.             <property name=“toplink.target-database” value=“oracle.toplink.essentials.platform.database.HSQLPlatform”/>  
  62.             <property name=“toplink.logging.level” value=“OFF”/>  
  63.             <property name=“toplink.orm.throw.exceptions” value=“true”/>  
  64.   
  65.             <property name=“toplink.ddl-generation” value=“drop-and-create-tables”/>  
  66.             <property name=“toplink.ddl-generation.output-mode” value=“database”/>  
  67.   
  68.         </properties>  
  69.     </persistence-unit>  
  70.     <persistence-unit name=“embeddedtoplink” transaction-type=“RESOURCE_LOCAL”>  
  71.         <provider>oracle.toplink.essentials.PersistenceProvider</provider>  
  72.         <class>org.compass.gps.device.jpa.model.Simple</class>  
  73.         <class>org.compass.gps.device.jpa.model.SimpleBase</class>  
  74.         <class>org.compass.gps.device.jpa.model.SimpleExtend</class>  
  75.         <exclude-unlisted-classes>false</exclude-unlisted-classes>  
  76.         <properties>  
  77.             <property name=“toplink.jdbc.driver” value=“org.hsqldb.jdbcDriver”/>  
  78.             <property name=“toplink.jdbc.url” value=“jdbc:hsqldb:mem:test”/>  
  79.             <property name=“toplink.jdbc.user” value=“sa”/>  
  80.             <property name=“toplink.jdbc.password” value=“”/>  
  81.             <property name=“toplink.target-database” value=“oracle.toplink.essentials.platform.database.HSQLPlatform”/>  
  82.             <property name=“toplink.logging.level” value=“OFF”/>  
  83.             <property name=“toplink.orm.throw.exceptions” value=“true”/>  
  84.   
  85.             <property name=“toplink.ddl-generation” value=“drop-and-create-tables”/>  
  86.             <property name=“toplink.ddl-generation.output-mode” value=“database”/>  
  87.   
  88.             <property name=“toplink.session.customizer”  
  89.                       value=“org.compass.gps.device.jpa.embedded.toplink.CompassSessionCustomizer”/>  
  90.   
  91.             <property name=“compass.engine.connection” value=“target/test-index”/>  
  92.             <property name=“compass.debug” value=“true” />  
  93.         </properties>  
  94.     </persistence-unit>  
  95.     <persistence-unit name=“hibernate” transaction-type=“RESOURCE_LOCAL”>  
  96.         <provider>org.hibernate.ejb.HibernatePersistence</provider>  
  97.         <class>org.compass.gps.device.jpa.model.Simple</class>  
  98.         <class>org.compass.gps.device.jpa.model.SimpleBase</class>  
  99.         <class>org.compass.gps.device.jpa.model.SimpleExtend</class>  
  100.         <exclude-unlisted-classes>false</exclude-unlisted-classes>  
  101.         <properties>  
  102.             <property name=“hibernate.dialect” value=“org.hibernate.dialect.HSQLDialect”/>  
  103.             <property name=“hibernate.connection.driver_class” value=“org.hsqldb.jdbcDriver”/>  
  104.             <property name=“hibernate.connection.url” value=“jdbc:hsqldb:mem:test”/>  
  105.             <property name=“hibernate.connection.username” value=“sa”/>  
  106.             <property name=“hibernate.connection.password” value=“”/>  
  107.             <property name=“hibernate.search.autoregister_listeners” value=“false”/>  
  108.   
  109.             <property name=“hibernate.hbm2ddl.auto” value=“create”/>  
  110.         </properties>  
  111.     </persistence-unit>  
  112.     <persistence-unit name=“embeddedhibernate” transaction-type=“RESOURCE_LOCAL”>  
  113.         <provider>org.hibernate.ejb.HibernatePersistence</provider>  
  114.         <class>org.compass.gps.device.jpa.model.Simple</class>  
  115.         <class>org.compass.gps.device.jpa.model.SimpleBase</class>  
  116.         <class>org.compass.gps.device.jpa.model.SimpleExtend</class>  
  117.         <exclude-unlisted-classes>false</exclude-unlisted-classes>  
  118.         <properties>  
  119.             <property name=“hibernate.dialect” value=“org.hibernate.dialect.HSQLDialect”/>  
  120.             <property name=“hibernate.connection.driver_class” value=“org.hsqldb.jdbcDriver”/>  
  121.             <property name=“hibernate.connection.url” value=“jdbc:hsqldb:mem:test”/>  
  122.             <property name=“hibernate.connection.username” value=“sa”/>  
  123.             <property name=“hibernate.connection.password” value=“”/>  
  124.             <property name=“hibernate.search.autoregister_listeners” value=“true”/>  
  125.   
  126.             <property name=“hibernate.hbm2ddl.auto” value=“create”/>  
  127.   
  128.             <property name=“compass.engine.connection” value=“target/test-index”/>  
  129.             <property name=“compass.debug” value=“true” />  
  130.         </properties>  
  131.     </persistence-unit>  
  132.     <persistence-unit name=“openjpa” transaction-type=“RESOURCE_LOCAL”>  
  133.         <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>  
  134.         <class>org.compass.gps.device.jpa.model.Simple</class>  
  135.         <class>org.compass.gps.device.jpa.model.SimpleBase</class>  
  136.         <class>org.compass.gps.device.jpa.model.SimpleExtend</class>  
  137.         <exclude-unlisted-classes>false</exclude-unlisted-classes>  
  138.         <properties>  
  139.             <property name=“openjpa.jdbc.DBDictionary” value=“hsql”/>  
  140.             <property name=“openjpa.ConnectionDriverName” value=“org.hsqldb.jdbcDriver”/>  
  141.             <property name=“openjpa.ConnectionURL” value=“jdbc:hsqldb:mem:test”/>  
  142.             <property name=“openjpa.ConnectionUserName” value=“sa”/>  
  143.             <property name=“openjpa.ConnectionPassword” value=“”/>  
  144.   
  145.             <property name=“openjpa.jdbc.SynchronizeMappings” value=“buildSchema”/>  
  146.         </properties>  
  147.     </persistence-unit>  
  148.   
  149.     <persistence-unit name=“embeddedopenjpa” transaction-type=“RESOURCE_LOCAL”>  
  150.         <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>  
  151.         <class>org.compass.gps.device.jpa.model.Simple</class>  
  152.         <class>org.compass.gps.device.jpa.model.SimpleBase</class>  
  153.         <class>org.compass.gps.device.jpa.model.SimpleExtend</class>  
  154.         <exclude-unlisted-classes>true</exclude-unlisted-classes>  
  155.         <properties>  
  156.             <property name=“openjpa.jdbc.DBDictionary” value=“hsql”/>  
  157.             <property name=“openjpa.ConnectionDriverName” value=“org.hsqldb.jdbcDriver”/>  
  158.             <property name=“openjpa.ConnectionURL” value=“jdbc:hsqldb:mem:test”/>  
  159.             <property name=“openjpa.ConnectionUserName” value=“sa”/>  
  160.             <property name=“openjpa.ConnectionPassword” value=“”/>  
  161.   
  162.             <property name=“openjpa.jdbc.SynchronizeMappings” value=“buildSchema”/>  
  163.   
  164.             <property name=“compass.engine.connection” value=“target/test-index”/>  
  165.             <property name=“compass.debug” value=“true” />  
  166.         </properties>  
  167.     </persistence-unit>  
  168. </persistence>

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/36500.html

(0)
编程小号编程小号

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注