- <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 persistence_1_0.xsd" version="1.0">
- <persistence-unit name="eclipselink" transaction-type="RESOURCE_LOCAL">
- <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
- <class>org.compass.gps.device.jpa.model.Simple</class>
- <class>org.compass.gps.device.jpa.model.SimpleBase</class>
- <class>org.compass.gps.device.jpa.model.SimpleExtend</class>
- <exclude-unlisted-classes>false</exclude-unlisted-classes>
- <properties>
- <property name="eclipselink.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
- <property name="eclipselink.jdbc.url" value="jdbc:hsqldb:mem:test"/>
- <property name="eclipselink.jdbc.user" value="sa"/>
- <property name="eclipselink.jdbc.password" value=""/>
- <property name="eclipselink.target-database"
- value="org.eclipse.persistence.platform.database.HSQLPlatform"/>
- <property name="eclipselink.logging.level" value="OFF"/>
- <property name="eclipselink.orm.throw.exceptions" value="true"/>
- <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
- <property name="eclipselink.ddl-generation.output-mode" value="database"/>
- </properties>
- </persistence-unit>
- <persistence-unit name="embeddedeclipselink" transaction-type="RESOURCE_LOCAL">
- <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
- <class>org.compass.gps.device.jpa.model.Simple</class>
- <class>org.compass.gps.device.jpa.model.SimpleBase</class>
- <class>org.compass.gps.device.jpa.model.SimpleExtend</class>
- <exclude-unlisted-classes>false</exclude-unlisted-classes>
- <properties>
- <property name="eclipselink.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
- <property name="eclipselink.jdbc.url" value="jdbc:hsqldb:mem:test"/>
- <property name="eclipselink.jdbc.user" value="sa"/>
- <property name="eclipselink.jdbc.password" value=""/>
- <property name="eclipselink.target-database"
- value="org.eclipse.persistence.platform.database.HSQLPlatform"/>
- <property name="eclipselink.logging.level" value="OFF"/>
- <property name="eclipselink.orm.throw.exceptions" value="true"/>
- <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
- <property name="eclipselink.ddl-generation.output-mode" value="database"/>
- <property name="eclipselink.session.customizer"
- value="org.compass.gps.device.jpa.embedded.eclipselink.CompassSessionCustomizer"/>
- <property name="compass.engine.connection" value="target/test-index"/>
- <property name="compass.debug" value="true" />
- </properties>
- </persistence-unit>
- <persistence-unit name="toplink" transaction-type="RESOURCE_LOCAL">
- <provider>oracle.toplink.essentials.PersistenceProvider</provider>
- <class>org.compass.gps.device.jpa.model.Simple</class>
- <class>org.compass.gps.device.jpa.model.SimpleBase</class>
- <class>org.compass.gps.device.jpa.model.SimpleExtend</class>
- <exclude-unlisted-classes>false</exclude-unlisted-classes>
- <properties>
- <property name="toplink.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
- <property name="toplink.jdbc.url" value="jdbc:hsqldb:mem:test"/>
- <property name="toplink.jdbc.user" value="sa"/>
- <property name="toplink.jdbc.password" value=""/>
- <property name="toplink.target-database" value="oracle.toplink.essentials.platform.database.HSQLPlatform"/>
- <property name="toplink.logging.level" value="OFF"/>
- <property name="toplink.orm.throw.exceptions" value="true"/>
- <property name="toplink.ddl-generation" value="drop-and-create-tables"/>
- <property name="toplink.ddl-generation.output-mode" value="database"/>
- </properties>
- </persistence-unit>
- <persistence-unit name="embeddedtoplink" transaction-type="RESOURCE_LOCAL">
- <provider>oracle.toplink.essentials.PersistenceProvider</provider>
- <class>org.compass.gps.device.jpa.model.Simple</class>
- <class>org.compass.gps.device.jpa.model.SimpleBase</class>
- <class>org.compass.gps.device.jpa.model.SimpleExtend</class>
- <exclude-unlisted-classes>false</exclude-unlisted-classes>
- <properties>
- <property name="toplink.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
- <property name="toplink.jdbc.url" value="jdbc:hsqldb:mem:test"/>
- <property name="toplink.jdbc.user" value="sa"/>
- <property name="toplink.jdbc.password" value=""/>
- <property name="toplink.target-database" value="oracle.toplink.essentials.platform.database.HSQLPlatform"/>
- <property name="toplink.logging.level" value="OFF"/>
- <property name="toplink.orm.throw.exceptions" value="true"/>
- <property name="toplink.ddl-generation" value="drop-and-create-tables"/>
- <property name="toplink.ddl-generation.output-mode" value="database"/>
- <property name="toplink.session.customizer"
- value="org.compass.gps.device.jpa.embedded.toplink.CompassSessionCustomizer"/>
- <property name="compass.engine.connection" value="target/test-index"/>
- <property name="compass.debug" value="true" />
- </properties>
- </persistence-unit>
- <persistence-unit name="hibernate" transaction-type="RESOURCE_LOCAL">
- <provider>org.hibernate.ejb.HibernatePersistence</provider>
- <class>org.compass.gps.device.jpa.model.Simple</class>
- <class>org.compass.gps.device.jpa.model.SimpleBase</class>
- <class>org.compass.gps.device.jpa.model.SimpleExtend</class>
- <exclude-unlisted-classes>false</exclude-unlisted-classes>
- <properties>
- <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
- <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
- <property name="hibernate.connection.url" value="jdbc:hsqldb:mem:test"/>
- <property name="hibernate.connection.username" value="sa"/>
- <property name="hibernate.connection.password" value=""/>
- <property name="hibernate.search.autoregister_listeners" value="false"/>
- <property name="hibernate.hbm2ddl.auto" value="create"/>
- </properties>
- </persistence-unit>
- <persistence-unit name="embeddedhibernate" transaction-type="RESOURCE_LOCAL">
- <provider>org.hibernate.ejb.HibernatePersistence</provider>
- <class>org.compass.gps.device.jpa.model.Simple</class>
- <class>org.compass.gps.device.jpa.model.SimpleBase</class>
- <class>org.compass.gps.device.jpa.model.SimpleExtend</class>
- <exclude-unlisted-classes>false</exclude-unlisted-classes>
- <properties>
- <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
- <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
- <property name="hibernate.connection.url" value="jdbc:hsqldb:mem:test"/>
- <property name="hibernate.connection.username" value="sa"/>
- <property name="hibernate.connection.password" value=""/>
- <property name="hibernate.search.autoregister_listeners" value="true"/>
- <property name="hibernate.hbm2ddl.auto" value="create"/>
- <property name="compass.engine.connection" value="target/test-index"/>
- <property name="compass.debug" value="true" />
- </properties>
- </persistence-unit>
- <persistence-unit name="openjpa" transaction-type="RESOURCE_LOCAL">
- <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
- <class>org.compass.gps.device.jpa.model.Simple</class>
- <class>org.compass.gps.device.jpa.model.SimpleBase</class>
- <class>org.compass.gps.device.jpa.model.SimpleExtend</class>
- <exclude-unlisted-classes>false</exclude-unlisted-classes>
- <properties>
- <property name="openjpa.jdbc.DBDictionary" value="hsql"/>
- <property name="openjpa.ConnectionDriverName" value="org.hsqldb.jdbcDriver"/>
- <property name="openjpa.ConnectionURL" value="jdbc:hsqldb:mem:test"/>
- <property name="openjpa.ConnectionUserName" value="sa"/>
- <property name="openjpa.ConnectionPassword" value=""/>
- <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema"/>
- </properties>
- </persistence-unit>
- <persistence-unit name="embeddedopenjpa" transaction-type="RESOURCE_LOCAL">
- <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
- <class>org.compass.gps.device.jpa.model.Simple</class>
- <class>org.compass.gps.device.jpa.model.SimpleBase</class>
- <class>org.compass.gps.device.jpa.model.SimpleExtend</class>
- <exclude-unlisted-classes>true</exclude-unlisted-classes>
- <properties>
- <property name="openjpa.jdbc.DBDictionary" value="hsql"/>
- <property name="openjpa.ConnectionDriverName" value="org.hsqldb.jdbcDriver"/>
- <property name="openjpa.ConnectionURL" value="jdbc:hsqldb:mem:test"/>
- <property name="openjpa.ConnectionUserName" value="sa"/>
- <property name="openjpa.ConnectionPassword" value=""/>
- <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema"/>
- <property name="compass.engine.connection" value="target/test-index"/>
- <property name="compass.debug" value="true" />
- </properties>
- </persistence-unit>
- </persistence>
- 浏览: 212763 次
- 性别:
- 来自: 上海
-
最新评论
-
masuweng:
写的太好了,
spring security oauth 2 客户端模式研究 sparklr2 tonr2 -
qq979418391:
楼主,继续翻译啊,英文文档看起来真费劲楼主神威!!!
Supporting Multiple Screens 翻译 支持各种屏幕(上) -
jibaole:
[color=green][/color]
数据权限设计 -
jackyrong:
楼主有更好的方法了么?
数据权限设计 -
a6230589:
这么好的东西居然没人顶,赞一个,期待楼主的下半篇翻译。
Supporting Multiple Screens 翻译 支持各种屏幕(上)
相关推荐
“persistence.xml”是JPA规范的一部分,用于配置Java应用程序的数据持久化设置。这个XML文件通常位于项目的“META-INF”目录下,它包含了关于实体类的元数据,以及如何管理和访问这些实体的数据库连接信息。 2. *...
总结来说,`persistence.xml`是Hibernate-Java项目中不可或缺的一部分,通过合理配置,我们可以有效地管理数据库连接、实体类和事务策略,从而实现高效的数据持久化操作。对于开发者而言,理解和掌握`persistence....
`persistence.xml` 文件是JPA项目的配置核心,其中定义了持久化单元(Persistence Unit),包括数据源信息、类路径、事务管理方式等配置。例如: ```xml <persistence-unit name="examplePU" transaction-type=...
2. **配置 OpenJPA**:创建一个 `persistence.xml` 文件,定义持久化单元(Persistence Unit),包括数据库连接信息、实体类等。 ```xml <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi=...
OpenJPA(Open Java Persistence API)是Apache软件基金会开发的一个开源项目,它是Java Persistence API (JPA) 的一个实现,用于管理Java应用程序中的对象-关系映射(ORM)。下面将详细介绍如何在不依赖于像Tomcat...
通过本文介绍的方法,你可以顺利地完成JPA环境的搭建,包括添加必要的依赖、配置persistence.xml文件以及可能的Spring Boot配置。掌握这些基础知识后,你就能够更好地利用JPA来进行数据库操作,提高Java Web应用程序...
persistence.xml文件是JPA的配置文件,该文件用于配置JPA provider的行为和参数。例如: * persistence-unit:定义了一个持久化单元 * provider:指定了JPA provider的类名,例如Hibernate * properties:定义了...
在Spring中,我们可以使用`persistence.xml`文件来配置数据源、实体扫描以及JPA供应商。以下是一个简单的例子: ```xml <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi=...
- 将 `<persistence-unit>` 元素中的 `<provider>` 属性值更改为 Hibernate 提供者的全限定类名(`org.hibernate.jpa.HibernatePersistence`)。 ```xml <persistence-unit name="myPersistenceUnit"> <provider>...
接下来,我们需要配置OpenJPA2,这通常在持久化单元(Persistence Unit)配置文件persistence.xml中完成。配置包括数据库连接信息、实体类的指定等: ```xml <persistence xmlns=...
首先,我们需要配置`persistence.xml`文件,这是JPA的核心配置文件,用于定义持久化单元和相关的属性。 `persistence.xml`文件应放置在类路径的`META-INF`目录下。在Maven项目中,通常会创建`src/main/resources/...
Spring的核心模块包括`spring-context`和`spring-jpa`,EclipseLink作为JPA实现,其依赖为`javax.persistence`和`org.eclipse.persistence`。Maven的配置通常如下: ```xml <groupId>org.springframework ...
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider> <class>com.example.MyEntity</class> <property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/mydb"/> ...
在描述的场景中,JPA连接数据库的过程是在`persistence.xml`配置文件中进行的。这个文件是JPA的配置中心,它定义了持久化单元(Persistence Unit),也就是数据库连接的相关信息。在这个例子中,配置文件内容如下: ...
在压缩包中,"spring+jpa"很可能包含了一系列配置文件,如`applicationContext.xml`用于配置Spring容器,`persistence.xml`用于配置JPA和Hibernate。这些文件通常会定义数据源、实体管理工厂、实体类、事务管理器等...
接下来,配置Hibernate JPA的属性,这通常在`persistence.xml`文件中完成,包括数据库连接信息、方言选择等。例如: ```xml <persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi=...
在本例中,`persistence.xml`文件是Hibernate的配置文件,用于定义数据源、实体管理工厂以及JPA供应商(如Hibernate)。配置示例如下: ```xml <persistence xmlns="http://java.sun.com/xml/ns/persistence" ...
2. **Persistence Provider**:JPA是一个规范,具体的实现称为持久化提供者,例如Hibernate、EclipseLink等。比如在使用Hibernate作为提供者时,需要包含`hibernate-entitymanager.jar`。这个jar文件包含了对JPA规范...
尽管像 Hibernate 和 TopLink 这样的专有对象关系映射 (ORM) 工具仍然存在,但它们现在都致力于通过 JPA API 提供其功能,从而使所有应用程序能够在不同的 JPA 实现之间移植。本文档将介绍 JPA 的基础知识,并指导...