|
|
|
@ -1,133 +1,149 @@
|
|
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
|
<persistence 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_2.xsd"
|
|
|
|
|
version="2.2">
|
|
|
|
|
|
|
|
|
|
<persistence-unit name="java-jpa-scheduled-day">
|
|
|
|
|
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
|
|
|
|
|
<class>com.baeldung.sqlresultsetmapping.ScheduledDay</class>
|
|
|
|
|
<class>com.baeldung.sqlresultsetmapping.Employee</class>
|
|
|
|
|
<exclude-unlisted-classes>true</exclude-unlisted-classes>
|
|
|
|
|
<properties>
|
|
|
|
|
<property name="javax.persistence.jdbc.driver" value="org.h2.Driver"/>
|
|
|
|
|
<property name="javax.persistence.jdbc.url"
|
|
|
|
|
value="jdbc:h2:mem:test;INIT=RUNSCRIPT FROM 'classpath:database.sql'"/>
|
|
|
|
|
<property name="javax.persistence.jdbc.user" value="sa"/>
|
|
|
|
|
<property name="javax.persistence.jdbc.password" value=""/>
|
|
|
|
|
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
|
|
|
|
|
<!--<property name="hibernate.hbm2ddl.auto" value="create-drop" />-->
|
|
|
|
|
<property name="show_sql" value="true"/>
|
|
|
|
|
<property name="hibernate.temp.use_jdbc_metadata_defaults" value="false"/>
|
|
|
|
|
</properties>
|
|
|
|
|
</persistence-unit>
|
|
|
|
|
|
|
|
|
|
<persistence-unit name="jpa-h2">
|
|
|
|
|
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
|
|
|
|
|
<class>com.baeldung.jpa.stringcast.Message</class>
|
|
|
|
|
<exclude-unlisted-classes>true</exclude-unlisted-classes>
|
|
|
|
|
<properties>
|
|
|
|
|
<property name="javax.persistence.jdbc.driver" value="org.h2.Driver"/>
|
|
|
|
|
<property name="javax.persistence.jdbc.url" value="jdbc:h2:mem:test"/>
|
|
|
|
|
<property name="javax.persistence.jdbc.user" value="sa"/>
|
|
|
|
|
<property name="javax.persistence.jdbc.password" value=""/>
|
|
|
|
|
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
|
|
|
|
|
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
|
|
|
|
|
<property name="show_sql" value="true"/>
|
|
|
|
|
<property name="hibernate.temp.use_jdbc_metadata_defaults" value="false"/>
|
|
|
|
|
</properties>
|
|
|
|
|
</persistence-unit>
|
|
|
|
|
|
|
|
|
|
<persistence-unit name="jpa-db">
|
|
|
|
|
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
|
|
|
|
|
<class>com.baeldung.jpa.model.Car</class>
|
|
|
|
|
<exclude-unlisted-classes>true</exclude-unlisted-classes>
|
|
|
|
|
<properties>
|
|
|
|
|
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
|
|
|
|
|
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://127.0.0.1:3306/baeldung"/>
|
|
|
|
|
<property name="javax.persistence.jdbc.user" value="baeldung"/>
|
|
|
|
|
<property name="javax.persistence.jdbc.password" value="YourPassword"/>
|
|
|
|
|
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
|
|
|
|
|
<property name="hibernate.show_sql" value="true"/>
|
|
|
|
|
</properties>
|
|
|
|
|
</persistence-unit>
|
|
|
|
|
|
|
|
|
|
<persistence-unit name="entity-graph-pu" transaction-type="RESOURCE_LOCAL">
|
|
|
|
|
<class>com.baeldung.jpa.entitygraph.model.Post</class>
|
|
|
|
|
<class>com.baeldung.jpa.entitygraph.model.User</class>
|
|
|
|
|
<class>com.baeldung.jpa.entitygraph.model.Comment</class>
|
|
|
|
|
<exclude-unlisted-classes>true</exclude-unlisted-classes>
|
|
|
|
|
<properties>
|
|
|
|
|
|
|
|
|
|
<!--H2-->
|
|
|
|
|
<property name="javax.persistence.jdbc.driver" value="org.h2.Driver"/>
|
|
|
|
|
<property name="javax.persistence.jdbc.url"
|
|
|
|
|
value="jdbc:h2:mem:entitygraphdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE"/>
|
|
|
|
|
|
|
|
|
|
<property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/>
|
|
|
|
|
<property name="javax.persistence.sql-load-script-source" value="data-init.sql"/>
|
|
|
|
|
</properties>
|
|
|
|
|
</persistence-unit>
|
|
|
|
|
|
|
|
|
|
<persistence-unit name="java8-datetime-postgresql" transaction-type="RESOURCE_LOCAL">
|
|
|
|
|
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
|
|
|
|
|
<class>com.baeldung.jpa.datetime.JPA22DateTimeEntity</class>
|
|
|
|
|
<exclude-unlisted-classes>true</exclude-unlisted-classes>
|
|
|
|
|
<properties>
|
|
|
|
|
<property name="javax.persistence.jdbc.driver" value="org.postgresql.Driver"/>
|
|
|
|
|
<property name="javax.persistence.jdbc.url" value="jdbc:postgresql://localhost:5432/java8-datetime2"/>
|
|
|
|
|
<property name="javax.persistence.jdbc.user" value="postgres"/>
|
|
|
|
|
<property name="javax.persistence.jdbc.password" value="postgres"/>
|
|
|
|
|
<property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/>
|
|
|
|
|
|
|
|
|
|
<!-- configure logging -->
|
|
|
|
|
<property name="eclipselink.logging.level" value="INFO"/>
|
|
|
|
|
<property name="eclipselink.logging.level.sql" value="FINE"/>
|
|
|
|
|
<property name="eclipselink.logging.parameters" value="true"/>
|
|
|
|
|
</properties>
|
|
|
|
|
</persistence-unit>
|
|
|
|
|
|
|
|
|
|
<persistence-unit name="jpa-h2-criteria">
|
|
|
|
|
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
|
|
|
|
|
<class>com.baeldung.jpa.criteria.entity.Item</class>
|
|
|
|
|
<exclude-unlisted-classes>true</exclude-unlisted-classes>
|
|
|
|
|
<properties>
|
|
|
|
|
<property name="javax.persistence.jdbc.driver"
|
|
|
|
|
value="org.h2.Driver" />
|
|
|
|
|
<property name="javax.persistence.jdbc.url"
|
|
|
|
|
value="jdbc:h2:mem:test" />
|
|
|
|
|
<property name="javax.persistence.jdbc.user" value="sa" />
|
|
|
|
|
<property name="javax.persistence.jdbc.password" value="" />
|
|
|
|
|
<property name="hibernate.dialect"
|
|
|
|
|
value="org.hibernate.dialect.H2Dialect" />
|
|
|
|
|
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
|
|
|
|
|
<property name="show_sql" value="true" />
|
|
|
|
|
<property name="hibernate.temp.use_jdbc_metadata_defaults"
|
|
|
|
|
value="false" />
|
|
|
|
|
<property name="javax.persistence.sql-load-script-source" value="item.sql"/>
|
|
|
|
|
</properties>
|
|
|
|
|
</persistence-unit>
|
|
|
|
|
|
|
|
|
|
<persistence-unit name="jpa-query-types">
|
|
|
|
|
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
|
|
|
|
|
<class>com.baeldung.jpa.querytypes.UserEntity</class>
|
|
|
|
|
<exclude-unlisted-classes>true</exclude-unlisted-classes>
|
|
|
|
|
<properties>
|
|
|
|
|
<property name="javax.persistence.jdbc.driver"
|
|
|
|
|
value="org.h2.Driver" />
|
|
|
|
|
<property name="javax.persistence.jdbc.url"
|
|
|
|
|
value="jdbc:h2:mem:test" />
|
|
|
|
|
<property name="javax.persistence.jdbc.user" value="sa" />
|
|
|
|
|
<property name="javax.persistence.jdbc.password" value="" />
|
|
|
|
|
<property name="hibernate.dialect"
|
|
|
|
|
value="org.hibernate.dialect.H2Dialect" />
|
|
|
|
|
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
|
|
|
|
|
<property name="show_sql" value="true" />
|
|
|
|
|
<property name="hibernate.temp.use_jdbc_metadata_defaults"
|
|
|
|
|
value="false" />
|
|
|
|
|
<property name="javax.persistence.sql-load-script-source" value="users.sql"/>
|
|
|
|
|
</properties>
|
|
|
|
|
</persistence-unit>
|
|
|
|
|
|
|
|
|
|
</persistence>
|
|
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
|
<persistence 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_2.xsd"
|
|
|
|
|
version="2.2">
|
|
|
|
|
|
|
|
|
|
<persistence-unit name="java-jpa-scheduled-day">
|
|
|
|
|
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
|
|
|
|
|
<class>com.baeldung.sqlresultsetmapping.ScheduledDay</class>
|
|
|
|
|
<class>com.baeldung.sqlresultsetmapping.Employee</class>
|
|
|
|
|
<exclude-unlisted-classes>true</exclude-unlisted-classes>
|
|
|
|
|
<properties>
|
|
|
|
|
<property name="javax.persistence.jdbc.driver" value="org.h2.Driver"/>
|
|
|
|
|
<property name="javax.persistence.jdbc.url"
|
|
|
|
|
value="jdbc:h2:mem:test;INIT=RUNSCRIPT FROM 'classpath:database.sql'"/>
|
|
|
|
|
<property name="javax.persistence.jdbc.user" value="sa"/>
|
|
|
|
|
<property name="javax.persistence.jdbc.password" value=""/>
|
|
|
|
|
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
|
|
|
|
|
<!--<property name="hibernate.hbm2ddl.auto" value="create-drop" />-->
|
|
|
|
|
<property name="show_sql" value="true"/>
|
|
|
|
|
<property name="hibernate.temp.use_jdbc_metadata_defaults" value="false"/>
|
|
|
|
|
</properties>
|
|
|
|
|
</persistence-unit>
|
|
|
|
|
|
|
|
|
|
<persistence-unit name="jpa-h2">
|
|
|
|
|
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
|
|
|
|
|
<class>com.baeldung.jpa.stringcast.Message</class>
|
|
|
|
|
<exclude-unlisted-classes>true</exclude-unlisted-classes>
|
|
|
|
|
<properties>
|
|
|
|
|
<property name="javax.persistence.jdbc.driver" value="org.h2.Driver"/>
|
|
|
|
|
<property name="javax.persistence.jdbc.url" value="jdbc:h2:mem:test"/>
|
|
|
|
|
<property name="javax.persistence.jdbc.user" value="sa"/>
|
|
|
|
|
<property name="javax.persistence.jdbc.password" value=""/>
|
|
|
|
|
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
|
|
|
|
|
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
|
|
|
|
|
<property name="show_sql" value="true"/>
|
|
|
|
|
<property name="hibernate.temp.use_jdbc_metadata_defaults" value="false"/>
|
|
|
|
|
</properties>
|
|
|
|
|
</persistence-unit>
|
|
|
|
|
|
|
|
|
|
<persistence-unit name="jpa-db">
|
|
|
|
|
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
|
|
|
|
|
<class>com.baeldung.jpa.model.Car</class>
|
|
|
|
|
<exclude-unlisted-classes>true</exclude-unlisted-classes>
|
|
|
|
|
<properties>
|
|
|
|
|
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
|
|
|
|
|
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://127.0.0.1:3306/baeldung"/>
|
|
|
|
|
<property name="javax.persistence.jdbc.user" value="baeldung"/>
|
|
|
|
|
<property name="javax.persistence.jdbc.password" value="YourPassword"/>
|
|
|
|
|
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
|
|
|
|
|
<property name="hibernate.show_sql" value="true"/>
|
|
|
|
|
</properties>
|
|
|
|
|
</persistence-unit>
|
|
|
|
|
|
|
|
|
|
<persistence-unit name="entity-graph-pu" transaction-type="RESOURCE_LOCAL">
|
|
|
|
|
<class>com.baeldung.jpa.entitygraph.model.Post</class>
|
|
|
|
|
<class>com.baeldung.jpa.entitygraph.model.User</class>
|
|
|
|
|
<class>com.baeldung.jpa.entitygraph.model.Comment</class>
|
|
|
|
|
<exclude-unlisted-classes>true</exclude-unlisted-classes>
|
|
|
|
|
<properties>
|
|
|
|
|
|
|
|
|
|
<!--H2-->
|
|
|
|
|
<property name="javax.persistence.jdbc.driver" value="org.h2.Driver"/>
|
|
|
|
|
<property name="javax.persistence.jdbc.url"
|
|
|
|
|
value="jdbc:h2:mem:entitygraphdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE"/>
|
|
|
|
|
|
|
|
|
|
<property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/>
|
|
|
|
|
<property name="javax.persistence.sql-load-script-source" value="data-init.sql"/>
|
|
|
|
|
</properties>
|
|
|
|
|
</persistence-unit>
|
|
|
|
|
|
|
|
|
|
<persistence-unit name="java8-datetime-postgresql" transaction-type="RESOURCE_LOCAL">
|
|
|
|
|
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
|
|
|
|
|
<class>com.baeldung.jpa.datetime.JPA22DateTimeEntity</class>
|
|
|
|
|
<exclude-unlisted-classes>true</exclude-unlisted-classes>
|
|
|
|
|
<properties>
|
|
|
|
|
<property name="javax.persistence.jdbc.driver" value="org.postgresql.Driver"/>
|
|
|
|
|
<property name="javax.persistence.jdbc.url" value="jdbc:postgresql://localhost:5432/java8-datetime2"/>
|
|
|
|
|
<property name="javax.persistence.jdbc.user" value="postgres"/>
|
|
|
|
|
<property name="javax.persistence.jdbc.password" value="postgres"/>
|
|
|
|
|
<property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/>
|
|
|
|
|
|
|
|
|
|
<!-- configure logging -->
|
|
|
|
|
<property name="eclipselink.logging.level" value="INFO"/>
|
|
|
|
|
<property name="eclipselink.logging.level.sql" value="FINE"/>
|
|
|
|
|
<property name="eclipselink.logging.parameters" value="true"/>
|
|
|
|
|
</properties>
|
|
|
|
|
</persistence-unit>
|
|
|
|
|
|
|
|
|
|
<persistence-unit name="jpa-h2-criteria">
|
|
|
|
|
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
|
|
|
|
|
<class>com.baeldung.jpa.criteria.entity.Item</class>
|
|
|
|
|
<exclude-unlisted-classes>true</exclude-unlisted-classes>
|
|
|
|
|
<properties>
|
|
|
|
|
<property name="javax.persistence.jdbc.driver"
|
|
|
|
|
value="org.h2.Driver" />
|
|
|
|
|
<property name="javax.persistence.jdbc.url"
|
|
|
|
|
value="jdbc:h2:mem:test" />
|
|
|
|
|
<property name="javax.persistence.jdbc.user" value="sa" />
|
|
|
|
|
<property name="javax.persistence.jdbc.password" value="" />
|
|
|
|
|
<property name="hibernate.dialect"
|
|
|
|
|
value="org.hibernate.dialect.H2Dialect" />
|
|
|
|
|
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
|
|
|
|
|
<property name="show_sql" value="true" />
|
|
|
|
|
<property name="hibernate.temp.use_jdbc_metadata_defaults"
|
|
|
|
|
value="false" />
|
|
|
|
|
<property name="javax.persistence.sql-load-script-source" value="item.sql"/>
|
|
|
|
|
</properties>
|
|
|
|
|
</persistence-unit>
|
|
|
|
|
|
|
|
|
|
<persistence-unit name="jpa-query-types">
|
|
|
|
|
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
|
|
|
|
|
<class>com.baeldung.jpa.querytypes.UserEntity</class>
|
|
|
|
|
<exclude-unlisted-classes>true</exclude-unlisted-classes>
|
|
|
|
|
<properties>
|
|
|
|
|
<property name="javax.persistence.jdbc.driver"
|
|
|
|
|
value="org.h2.Driver" />
|
|
|
|
|
<property name="javax.persistence.jdbc.url"
|
|
|
|
|
value="jdbc:h2:mem:test" />
|
|
|
|
|
<property name="javax.persistence.jdbc.user" value="sa" />
|
|
|
|
|
<property name="javax.persistence.jdbc.password" value="" />
|
|
|
|
|
<property name="hibernate.dialect"
|
|
|
|
|
value="org.hibernate.dialect.H2Dialect" />
|
|
|
|
|
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
|
|
|
|
|
<property name="show_sql" value="true" />
|
|
|
|
|
<property name="hibernate.temp.use_jdbc_metadata_defaults"
|
|
|
|
|
value="false" />
|
|
|
|
|
<property name="javax.persistence.sql-load-script-source" value="users.sql"/>
|
|
|
|
|
</properties>
|
|
|
|
|
</persistence-unit>
|
|
|
|
|
|
|
|
|
|
<persistence-unit name="entity-default-values">
|
|
|
|
|
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
|
|
|
|
|
<class>com.baeldung.jpa.defaultvalues.User</class>
|
|
|
|
|
<exclude-unlisted-classes>true</exclude-unlisted-classes>
|
|
|
|
|
<properties>
|
|
|
|
|
<property name="javax.persistence.jdbc.driver" value="org.h2.Driver" />
|
|
|
|
|
<property name="javax.persistence.jdbc.url" value="jdbc:h2:mem:test" />
|
|
|
|
|
<property name="javax.persistence.jdbc.user" value="sa" />
|
|
|
|
|
<property name="javax.persistence.jdbc.password" value="" />
|
|
|
|
|
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect" />
|
|
|
|
|
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
|
|
|
|
|
<property name="show_sql" value="true" />
|
|
|
|
|
<property name="hibernate.temp.use_jdbc_metadata_defaults" value="false" />
|
|
|
|
|
</properties>
|
|
|
|
|
</persistence-unit>
|
|
|
|
|
|
|
|
|
|
</persistence>
|
|
|
|
|