Add the Hibernate configuration.

main
KKlochko 2 years ago
parent c947dc3460
commit 736aa2c530

@ -0,0 +1,48 @@
<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 http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="jpa_hospital_example">
<description>
Persistence unit for the Jakarta Persistence of the JPA Hospital Example.
</description>
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<class>space.kklochko.jpa_hospital_example.models.Department</class>
<class>space.kklochko.jpa_hospital_example.models.Patient</class>
<class>space.kklochko.jpa_hospital_example.models.Indicator</class>
<properties>
<property name="jakarta.persistence.jdbc.driver" value="org.postgresql.Driver" />
<property name="jakarta.persistence.jdbc.url" value="jdbc:postgresql://localhost:5432/testdb" />
<property name="jakarta.persistence.jdbc.user" value="user" />
<property name="jakarta.persistence.jdbc.password" value="testpassword" />
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
<!-- Auto create the tables of the entities if they are not exist -->
<property name="hibernate.hbm2ddl.auto" value="create" />
</properties>
</persistence-unit>
<persistence-unit name="testing">
<description>
Test persistence unit for the Jakarta Persistence of the JPA Hospital Example.
</description>
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
<class>space.kklochko.jpa_hospital_example.models.Department</class>
<class>space.kklochko.jpa_hospital_example.models.Patient</class>
<class>space.kklochko.jpa_hospital_example.models.Indicator</class>
<properties>
<property name="jakarta.persistence.jdbc.driver" value="org.postgresql.Driver" />
<property name="jakarta.persistence.jdbc.url" value="jdbc:postgresql://postgres:5432/testdb" />
<property name="jakarta.persistence.jdbc.user" value="user" />
<property name="jakarta.persistence.jdbc.password" value="testpassword" />
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
<!-- Auto create the tables of the entities if they are not exist -->
<property name="hibernate.hbm2ddl.auto" value="create" />
</properties>
</persistence-unit>
</persistence>
Loading…
Cancel
Save