【发布时间】:2014-11-21 04:50:08
【问题描述】:
我正在构建一个使用 h2 数据库的应用程序,我的 persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="taskUnit" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<class>com.github.tarrsalah.jersey.todo.app.model.Task</class>
<properties>
<property name="javax.persistence.jdbc.url" value="jdbc:h2:file:/home/tarrsalah/src/github.com/tarrsalah/jaxrs-todo-app/target/todo"/>
<property name="javax.persistence.jdbc.user" value=""/>
<property name="javax.persistence.jdbc.driver" value="org.h2.Driver"/>
<property name="javax.persistence.jdbc.password" value=""/>
</properties>
</persistence-unit>
</persistence>
如您所见,我在 javax.persistence.jdbc.url 属性中有一个指向本地 h2 数据库的硬链接,我想在 github 上分享我的代码。
如何在不更改 persistence.xml 配置文件的情况下使我的代码的克隆版本正常工作?
(PS:我正在使用flyway进行数据库迁移)
【问题讨论】: