wildfly h2 database (#2889)

This commit is contained in:
Mitja Jeseničnik Kotnik 2017-10-30 22:55:20 +01:00 committed by adamd1985
parent a193fbb53f
commit e22b382427
2 changed files with 8 additions and 1 deletions

View File

@ -3,7 +3,13 @@
xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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"> xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="wildfly-jpa" transaction-type="JTA"> <persistence-unit name="wildfly-jpa" transaction-type="JTA">
<jta-data-source>java:/PostgresDS</jta-data-source> <jta-data-source>java:/H2DS</jta-data-source>
<class>model.User</class> <class>model.User</class>
<properties>
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.hbm2ddl.auto" value="create" />
<property name="hibernate.hbm2ddl.import_files" value="data.sql" />
</properties>
</persistence-unit> </persistence-unit>
</persistence> </persistence>

View File

@ -0,0 +1 @@
INSERT INTO users (username, email, postal_number) VALUES ('user1', 'user1@baeldung.com', 1000), ('user2', 'user2@baeldung.com', 2);