Skip to content

Commit e22b382

Browse files
cotnicadamd1985
authored andcommitted
wildfly h2 database (eugenp#2889)
1 parent a193fbb commit e22b382

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

‎ejb/wildfly/wildfly-jpa/src/main/resources/META-INF/persistence.xml‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
55
<persistence-unit name="wildfly-jpa" transaction-type="JTA">
6-
<jta-data-source>java:/PostgresDS</jta-data-source>
6+
<jta-data-source>java:/H2DS</jta-data-source>
77
<class>model.User</class>
8+
<properties>
9+
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
10+
<property name="hibernate.show_sql" value="true" />
11+
<property name="hibernate.hbm2ddl.auto" value="create" />
12+
<property name="hibernate.hbm2ddl.import_files" value="data.sql" />
13+
</properties>
814
</persistence-unit>
915
</persistence>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
INSERT INTO users (username, email, postal_number) VALUES ('user1', 'user1@baeldung.com', 1000), ('user2', 'user2@baeldung.com', 2);

0 commit comments

Comments
 (0)