]> juplo.de Git - hibernate-maven-plugin/commitdiff
Upgraded Hibernate 5.3.9.Final to 5.4.2.Final
authorKai Moritz <kai@juplo.de>
Fri, 5 Apr 2019 13:59:40 +0000 (15:59 +0200)
committerKai Moritz <kai@juplo.de>
Fri, 5 Apr 2019 14:06:47 +0000 (16:06 +0200)
Also configured the 5.4.2-tutorials as integration-test for the plugin

26 files changed:
pom.xml
src/it/hibernate4-maven-plugin-envers-sample/drop-tables-hsqldb.sql
src/it/tutorials-5.4.2/annotations/pom.xml
src/it/tutorials-5.4.2/annotations/src/test/resources/hibernate.cfg.xml
src/it/tutorials-5.4.2/basic/pom.xml
src/it/tutorials-5.4.2/basic/src/test/resources/hibernate.cfg.xml
src/it/tutorials-5.4.2/entitymanager/pom.xml
src/it/tutorials-5.4.2/entitymanager/src/test/resources/META-INF/persistence.xml
src/it/tutorials-5.4.2/envers/pom.xml
src/it/tutorials-5.4.2/envers/src/test/resources/META-INF/persistence.xml
src/it/tutorials-5.4.2/osgi/managed-jpa/pom.xml
src/it/tutorials-5.4.2/osgi/unmanaged-jpa/pom.xml
src/it/tutorials-5.4.2/osgi/unmanaged-jpa/src/main/resources/META-INF/persistence.xml
src/it/tutorials-5.4.2/osgi/unmanaged-native/pom.xml
src/it/tutorials-5.4.2/osgi/unmanaged-native/src/main/resources/hibernate.cfg.xml
src/it/tutorials-5.4.2/osgi/unmanaged-native/src/main/resources/pool-one.properties
src/it/tutorials-5.4.2/pom.xml
src/it/tutorials-5.4.2/schema-annotations.sql [new file with mode: 0644]
src/it/tutorials-5.4.2/schema-basic.sql [new file with mode: 0644]
src/it/tutorials-5.4.2/schema-entitymanager.sql [new file with mode: 0644]
src/it/tutorials-5.4.2/schema-envers.sql [new file with mode: 0644]
src/it/tutorials-5.4.2/schema-osgi-managed-jpa.sql [new file with mode: 0644]
src/it/tutorials-5.4.2/schema-osgi-unmanaged-jpa.sql [new file with mode: 0644]
src/it/tutorials-5.4.2/schema-osgi-unmanaged-native.sql [new file with mode: 0644]
src/it/tutorials-5.4.2/verify.bsh [new file with mode: 0644]
src/it/update/update.sql

diff --git a/pom.xml b/pom.xml
index 8d6e84321aecb8a51d04b12fe95e5b28a59a1862..d768239f1f26af0fbe6da321324533e32fe24d43 100644 (file)
--- a/pom.xml
+++ b/pom.xml
     <!-- Zeichensatz -->
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <!-- Verwendete Versionen -->
-    <hibernate.version>5.3.9.Final</hibernate.version>
+    <hibernate.version>5.4.2.Final</hibernate.version>
     <el-api.version>3.0.1-b06</el-api.version>
     <maven.version>3.6.0</maven.version>
     <maven-plugin-log4j.version>1.0.1</maven-plugin-log4j.version>
index b1387e801de04e54a84b52e31e74642839eb007a..c2ebbecdb6d05a05830799ee468ca607fe4fbd2c 100644 (file)
@@ -1,12 +1,9 @@
 
-    alter table TTL_EVENT_AUD 
-        drop constraint FK295td34se5kaxwgo8i1ph0k4;
+    drop table if exists TTL_AUDIT_REVISION CASCADE ;
 
-    drop table TTL_AUDIT_REVISION if exists;
+    drop table if exists TTL_EVENT CASCADE ;
 
-    drop table TTL_EVENT if exists;
-
-    drop table TTL_EVENT_AUD if exists;
+    drop table if exists TTL_EVENT_AUD CASCADE ;
 
     drop sequence TTL_AUDIT_REVISION_SEQ if exists;
 
index ac85dce22d160c241faa3751cb80d161ee01424f..b062672c56719541d3b66328eb033058f3ccac0a 100644 (file)
     <properties>
         <!-- Skip artifact deployment -->
         <maven.deploy.skip>true</maven.deploy.skip>
+        <hibernate-maven-plugin.version>@project.version@</hibernate-maven-plugin.version>
     </properties>
 
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>de.juplo</groupId>
+                <artifactId>hibernate-maven-plugin</artifactId>
+                <version>${hibernate-maven-plugin.version}</version>
+                <executions>
+                    <execution>
+                        <phase>process-test-classes</phase>
+                        <goals>
+                            <goal>create</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <scanTestClasses>true</scanTestClasses>
+                    <format>true</format>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
 </project>
index a9590c18778a866665c9dc1b5a64ef528827f8fc..df29d830663fd1f0edd7196bae6b1b6b705cff6c 100644 (file)
@@ -15,7 +15,7 @@
 
         <!-- Database connection settings -->
         <property name="connection.driver_class">org.h2.Driver</property>
-        <property name="connection.url">jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE</property>
+        <property name="connection.url">jdbc:h2:${project.build.directory}/db/test;MVCC=TRUE</property>
         <property name="connection.username">sa</property>
         <property name="connection.password"></property>
 
@@ -31,9 +31,6 @@
         <!-- Echo all executed SQL to stdout -->
         <property name="show_sql">true</property>
 
-        <!-- Drop and re-create the database schema on startup -->
-        <property name="hbm2ddl.auto">create</property>
-
         <!-- Names the annotated entity class -->
         <mapping class="org.hibernate.tutorial.annotations.Event"/>
 
index 43e25859fbafa58f824f49c8d046044366917ea5..e863c0af0453b65ba45c96917018afc9c67bd407 100644 (file)
     <properties>
         <!-- Skip artifact deployment -->
         <maven.deploy.skip>true</maven.deploy.skip>
+        <hibernate-maven-plugin.version>@project.version@</hibernate-maven-plugin.version>
     </properties>
 
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>de.juplo</groupId>
+                <artifactId>hibernate-maven-plugin</artifactId>
+                <version>${hibernate-maven-plugin.version}</version>
+                <executions>
+                    <execution>
+                        <phase>process-test-classes</phase>
+                        <goals>
+                            <goal>create</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <scanTestClasses>true</scanTestClasses>
+                    <format>true</format>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
 </project>
index 03d39373c3fa4ccf404f0fac1745e261d960bdea..df55e966f71cbe7827bc110ff38ce775e2188400 100644 (file)
@@ -15,7 +15,7 @@
 
         <!-- Database connection settings -->
         <property name="connection.driver_class">org.h2.Driver</property>
-        <property name="connection.url">jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE</property>
+        <property name="connection.url">jdbc:h2:${project.build.directory}/db/test;MVCC=TRUE</property>
         <property name="connection.username">sa</property>
         <property name="connection.password"/>
 
index b5b34ea50fd9e7a81259f736c8579fde5d061574..be6f9ccc2c7b187c135c712b219f30ce8a360776 100644 (file)
@@ -23,6 +23,7 @@
     <properties>
         <!-- Skip artifact deployment -->
         <maven.deploy.skip>true</maven.deploy.skip>
+        <hibernate-maven-plugin.version>@project.version@</hibernate-maven-plugin.version>
     </properties>
 
     <dependencies>
         </dependency>
     </dependencies>
 
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>de.juplo</groupId>
+                <artifactId>hibernate-maven-plugin</artifactId>
+                <version>${hibernate-maven-plugin.version}</version>
+                <executions>
+                    <execution>
+                        <phase>process-test-classes</phase>
+                        <goals>
+                            <goal>create</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <scanTestClasses>true</scanTestClasses>
+                    <dialect>org.hibernate.dialect.H2Dialect</dialect>
+                    <format>true</format>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
 </project>
index 0fc9523813810b58411baa9b9e0022b73a4e6584..edf700532c383bcd2887089a91cae8f21f01efbd 100644 (file)
@@ -18,7 +18,7 @@
 
         <properties>
             <property name="javax.persistence.jdbc.driver" value="org.h2.Driver" />
-            <property name="javax.persistence.jdbc.url" value="jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE" />
+            <property name="javax.persistence.jdbc.url" value="jdbc:h2:${project.build.directory}/db/test;MVCC=TRUE" />
             <property name="javax.persistence.jdbc.user" value="sa" />
             <property name="javax.persistence.jdbc.password" value="" />
 
index ea04958822f058aeb9eff328482014fd608ee14d..bf04daab1acb829175cb2d5b9e8b0778f66abda9 100644 (file)
@@ -23,6 +23,7 @@
     <properties>
         <!-- Skip artifact deployment -->
         <maven.deploy.skip>true</maven.deploy.skip>
+        <hibernate-maven-plugin.version>@project.version@</hibernate-maven-plugin.version>
     </properties>
 
     <dependencies>
         </dependency>
     </dependencies>
 
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>de.juplo</groupId>
+                <artifactId>hibernate-maven-plugin</artifactId>
+                <version>${hibernate-maven-plugin.version}</version>
+                <executions>
+                    <execution>
+                        <phase>process-test-classes</phase>
+                        <goals>
+                            <goal>create</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <scanTestClasses>true</scanTestClasses>
+                    <dialect>org.hibernate.dialect.H2Dialect</dialect>
+                    <format>true</format>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
 </project>
index 45a7dafe73cfabfbb2c8d9d1c74c0a948bd69b3b..fadc2a30e29f3690c25f7f22fcc99846d11f6154 100644 (file)
@@ -18,7 +18,7 @@
 
         <properties>
             <property name="javax.persistence.jdbc.driver" value="org.h2.Driver" />
-            <property name="javax.persistence.jdbc.url" value="jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE" />
+            <property name="javax.persistence.jdbc.url" value="jdbc:h2:${project.build.directory}/db/test;MVCC=TRUE" />
             <property name="javax.persistence.jdbc.user" value="sa" />
             <property name="javax.persistence.jdbc.password" value="" />
 
index 55ccacd3c9bd693214b5f6cf036ffa74b6452b11..35ad150e89056b32b14d016e14683da322d67ef0 100644 (file)
   <version>1.0.0</version>
   <packaging>bundle</packaging>
 
+  <properties>
+    <hibernate-maven-plugin.version>@project.version@</hibernate-maven-plugin.version>
+  </properties>
+
   <dependencies>
     <dependency>
       <groupId>org.hibernate.javax.persistence</groupId>
           </instructions>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>de.juplo</groupId>
+        <artifactId>hibernate-maven-plugin</artifactId>
+        <version>${hibernate-maven-plugin.version}</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>create</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <url>jdbc:h2:mem:db_managed_jpa;MVCC=TRUE</url>
+          <format>true</format>
+          <execute>false</execute>
+        </configuration>
+      </plugin>
     </plugins>
   </build>
 </project>
index ca5854ecc9ab91ee8ef7df8a8a1bebd3971eb2d1..297fed2a7e07d9ed8ad6659f2ec86ca9e41a07f7 100644 (file)
   <version>1.0.0</version>
   <packaging>bundle</packaging>
 
+  <properties>
+    <hibernate-maven-plugin.version>@project.version@</hibernate-maven-plugin.version>
+  </properties>
+
   <dependencies>
     <dependency>
       <groupId>org.hibernate.javax.persistence</groupId>
           </instructions>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>de.juplo</groupId>
+        <artifactId>hibernate-maven-plugin</artifactId>
+        <version>${hibernate-maven-plugin.version}</version>
+        <configuration>
+          <format>true</format>
+        </configuration>
+        <executions>
+          <execution>
+            <goals>
+              <goal>create</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
 </project>
index b0ebfe7053b1550669dcb73bdb3ab7dcd2fcb906..788ccab9a1d2bfe3c89915d4545a6e83093749dc 100644 (file)
         <properties>
             <property name="hibernate.connection.driver_class" value="org.h2.Driver"/>
             <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
-            <property name="hibernate.connection.url" value="jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE"/>
+            <property name="hibernate.connection.url" value="jdbc:h2:mem:db_unmanaged_jpa;DB_CLOSE_DELAY=-1;MVCC=TRUE"/>
             <property name="hibernate.connection.username" value="sa"/>
             <property name="hibernate.connection.password" value=""/>
             <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
         </properties>
     </persistence-unit>
-</persistence>
\ No newline at end of file
+</persistence>
index 582ccfe5c3a1f755a671914811399b8190912ee2..ce9b548a0ee492613f2b86f96177bd4f57f6c87a 100644 (file)
   <version>1.0.0</version>
   <packaging>bundle</packaging>
 
+  <properties>
+    <hibernate-maven-plugin.version>@project.version@</hibernate-maven-plugin.version>
+  </properties>
+
   <dependencies>
     <dependency>
       <groupId>org.hibernate.javax.persistence</groupId>
           </instructions>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>de.juplo</groupId>
+        <artifactId>hibernate-maven-plugin</artifactId>
+        <version>${hibernate-maven-plugin.version}</version>
+        <configuration>
+          <format>true</format>
+        </configuration>
+        <executions>
+          <execution>
+            <goals>
+              <goal>create</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
   </build>
 </project>
index 7f9f2380c9028fcfd30c6a347b12d3d938819c84..175a2bf8f174480da9f463a1cb6ebff3d8e9b7bb 100644 (file)
@@ -12,7 +12,7 @@
 <hibernate-configuration>
     <session-factory>
         <property name="hibernate.connection.driver_class">org.h2.Driver</property>
-        <property name="hibernate.connection.url">jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE</property>
+        <property name="hibernate.connection.url">jdbc:h2:mem:db_unmanaged_native;DB_CLOSE_DELAY=-1;MVCC=TRUE</property>
         <property name="hibernate.connection.username">sa</property>
         <property name="hibernate.connection.password"></property>
         <property name="hibernate.dialect">org.hibernate.dialect.H2Dialect</property>
index 7e1c4cf1bac60532286b9f7190f89542cbcc68cc..0085971f2ff09d4533b6dc7f64162ef812aa6102 100644 (file)
@@ -5,9 +5,9 @@
 # See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
 #
 jdbc-0.proxool.alias=pool-one
-jdbc-0.proxool.driver-url=jdbc:h2:mem:db1;DB_CLOSE_DELAY=-1;MVCC=TRUE
+jdbc-0.proxool.driver-url=jdbc:h2:mem:db_unmanaged_native;DB_CLOSE_DELAY=-1;MVCC=TRUE
 jdbc-0.proxool.driver-class=org.h2.Driver
 jdbc-0.user=sa
 jdbc-0.password=
 jdbc-0.proxool.maximum-connection-count=2
-jdbc-0.proxool.house-keeping-test-sql=select CURRENT_DATE
\ No newline at end of file
+jdbc-0.proxool.house-keeping-test-sql=select CURRENT_DATE
index 2b6add21ef670f0517b77b3f056a64d2ffc80563..d20f808549564c0e46a480e282e8851d4a91037a 100644 (file)
@@ -70,6 +70,7 @@
             </testResource>
             <testResource>
                 <directory>src/test/resources</directory>
+                <filtering>true</filtering>
             </testResource>
         </testResources>
     </build>
diff --git a/src/it/tutorials-5.4.2/schema-annotations.sql b/src/it/tutorials-5.4.2/schema-annotations.sql
new file mode 100644 (file)
index 0000000..48eb18e
--- /dev/null
@@ -0,0 +1,7 @@
+
+    create table EVENTS (
+        id bigint not null,
+        EVENT_DATE timestamp,
+        title varchar(255),
+        primary key (id)
+    );
diff --git a/src/it/tutorials-5.4.2/schema-basic.sql b/src/it/tutorials-5.4.2/schema-basic.sql
new file mode 100644 (file)
index 0000000..c5e2c0e
--- /dev/null
@@ -0,0 +1,7 @@
+
+    create table EVENTS (
+        EVENT_ID bigint not null,
+        EVENT_DATE timestamp,
+        title varchar(255),
+        primary key (EVENT_ID)
+    );
diff --git a/src/it/tutorials-5.4.2/schema-entitymanager.sql b/src/it/tutorials-5.4.2/schema-entitymanager.sql
new file mode 100644 (file)
index 0000000..48eb18e
--- /dev/null
@@ -0,0 +1,7 @@
+
+    create table EVENTS (
+        id bigint not null,
+        EVENT_DATE timestamp,
+        title varchar(255),
+        primary key (id)
+    );
diff --git a/src/it/tutorials-5.4.2/schema-envers.sql b/src/it/tutorials-5.4.2/schema-envers.sql
new file mode 100644 (file)
index 0000000..ecec80e
--- /dev/null
@@ -0,0 +1,27 @@
+
+    create table EVENTS (
+        id bigint not null,
+        EVENT_DATE timestamp,
+        title varchar(255),
+        primary key (id)
+    );
+
+    create table EVENTS_AUD (
+        id bigint not null,
+        REV integer not null,
+        REVTYPE tinyint,
+        EVENT_DATE timestamp,
+        title varchar(255),
+        primary key (id, REV)
+    );
+
+    create table REVINFO (
+        REV integer generated by default as identity,
+        REVTSTMP bigint,
+        primary key (REV)
+    );
+
+    alter table EVENTS_AUD 
+        add constraint FK5cembm6xahf542q8e4h0pq2t1 
+        foreign key (REV) 
+        references REVINFO;
diff --git a/src/it/tutorials-5.4.2/schema-osgi-managed-jpa.sql b/src/it/tutorials-5.4.2/schema-osgi-managed-jpa.sql
new file mode 100644 (file)
index 0000000..de92e46
--- /dev/null
@@ -0,0 +1,7 @@
+create sequence hibernate_sequence start with 1 increment by 1;
+
+    create table DataPoint (
+        id bigint not null,
+        name varchar(255),
+        primary key (id)
+    );
diff --git a/src/it/tutorials-5.4.2/schema-osgi-unmanaged-jpa.sql b/src/it/tutorials-5.4.2/schema-osgi-unmanaged-jpa.sql
new file mode 100644 (file)
index 0000000..de92e46
--- /dev/null
@@ -0,0 +1,7 @@
+create sequence hibernate_sequence start with 1 increment by 1;
+
+    create table DataPoint (
+        id bigint not null,
+        name varchar(255),
+        primary key (id)
+    );
diff --git a/src/it/tutorials-5.4.2/schema-osgi-unmanaged-native.sql b/src/it/tutorials-5.4.2/schema-osgi-unmanaged-native.sql
new file mode 100644 (file)
index 0000000..d89e280
--- /dev/null
@@ -0,0 +1,26 @@
+create sequence hibernate_sequence start with 1 increment by 1;
+
+    create table DataPoint (
+        id bigint not null,
+        name varchar(255),
+        primary key (id)
+    );
+
+    create table DataPoint_AUD (
+        id bigint not null,
+        REV integer not null,
+        REVTYPE tinyint,
+        name varchar(255),
+        primary key (id, REV)
+    );
+
+    create table REVINFO (
+        REV integer generated by default as identity,
+        REVTSTMP bigint,
+        primary key (REV)
+    );
+
+    alter table DataPoint_AUD 
+        add constraint FK43jw6b5mtbfxur0xhyjxynbea 
+        foreign key (REV) 
+        references REVINFO;
diff --git a/src/it/tutorials-5.4.2/verify.bsh b/src/it/tutorials-5.4.2/verify.bsh
new file mode 100644 (file)
index 0000000..9156c4a
--- /dev/null
@@ -0,0 +1,19 @@
+import de.juplo.test.FileComparator;
+
+
+FileComparator comparator = new FileComparator(basedir);
+
+if (!comparator.isEqual("schema-annotations.sql","annotations/target/create.sql"))
+  return false;
+if (!comparator.isEqual("schema-basic.sql","basic/target/create.sql"))
+  return false;
+if (!comparator.isEqual("schema-entitymanager.sql","entitymanager/target/create.sql"))
+  return false;
+if (!comparator.isEqual("schema-envers.sql","envers/target/create.sql"))
+  return false;
+if (!comparator.isEqual("schema-osgi-managed-jpa.sql","osgi/managed-jpa/target/create.sql"))
+  return false;
+if (!comparator.isEqual("schema-osgi-unmanaged-jpa.sql","osgi/unmanaged-jpa/target/create.sql"))
+  return false;
+if (!comparator.isEqual("schema-osgi-unmanaged-native.sql","osgi/unmanaged-native/target/create.sql"))
+  return false;
index d739136f4a997b688e3e6908ee48701b3f808e9a..2d5d891fbc79566014dc02d840a46d6da144a543 100644 (file)
@@ -1,3 +1,3 @@
 
-    alter table TEST.PUBLIC.EVENTS 
+    alter table EVENTS 
        add column MY_NEW_EVENT_DATE_COLUMN timestamp;