Added script to check outcome of the hibernate-tutorials
authorKai Moritz <km@juplo.de>
Sat, 16 May 2015 12:14:44 +0000 (14:14 +0200)
committerKai Moritz <km@juplo.de>
Sat, 16 May 2015 14:02:06 +0000 (16:02 +0200)
src/it/tutorials/schema-annotations.sql [new file with mode: 0644]
src/it/tutorials/schema-basic.sql [new file with mode: 0644]
src/it/tutorials/schema-entitymanager.sql [new file with mode: 0644]
src/it/tutorials/schema-envers.sql [new file with mode: 0644]
src/it/tutorials/schema-osgi-managed-jpa.sql [new file with mode: 0644]
src/it/tutorials/schema-osgi-unmanaged-jpa.sql [new file with mode: 0644]
src/it/tutorials/schema-osgi-unmanaged-native.sql [new file with mode: 0644]
src/it/tutorials/verify.bsh [new file with mode: 0644]

diff --git a/src/it/tutorials/schema-annotations.sql b/src/it/tutorials/schema-annotations.sql
new file mode 100644 (file)
index 0000000..8448e8a
--- /dev/null
@@ -0,0 +1,9 @@
+
+    drop table EVENTS if exists;
+
+    create table EVENTS (
+        id bigint not null,
+        EVENT_DATE timestamp,
+        title varchar(255),
+        primary key (id)
+    );
diff --git a/src/it/tutorials/schema-basic.sql b/src/it/tutorials/schema-basic.sql
new file mode 100644 (file)
index 0000000..4da1a3c
--- /dev/null
@@ -0,0 +1,9 @@
+
+    drop table EVENTS if exists;
+
+    create table EVENTS (
+        EVENT_ID bigint not null,
+        EVENT_DATE timestamp,
+        title varchar(255),
+        primary key (EVENT_ID)
+    );
diff --git a/src/it/tutorials/schema-entitymanager.sql b/src/it/tutorials/schema-entitymanager.sql
new file mode 100644 (file)
index 0000000..8448e8a
--- /dev/null
@@ -0,0 +1,9 @@
+
+    drop table EVENTS if exists;
+
+    create table EVENTS (
+        id bigint not null,
+        EVENT_DATE timestamp,
+        title varchar(255),
+        primary key (id)
+    );
diff --git a/src/it/tutorials/schema-envers.sql b/src/it/tutorials/schema-envers.sql
new file mode 100644 (file)
index 0000000..44643fa
--- /dev/null
@@ -0,0 +1,33 @@
+
+    drop table EVENTS if exists;
+
+    drop table EVENTS_AUD if exists;
+
+    drop table REVINFO if exists;
+
+    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 FK_3hegaqrrpmx0jj0c8qacjtira 
+        foreign key (REV) 
+        references REVINFO;
diff --git a/src/it/tutorials/schema-osgi-managed-jpa.sql b/src/it/tutorials/schema-osgi-managed-jpa.sql
new file mode 100644 (file)
index 0000000..66738bb
--- /dev/null
@@ -0,0 +1,8 @@
+
+    drop table DataPoint if exists;
+
+    create table DataPoint (
+        id bigint generated by default as identity,
+        name varchar(255),
+        primary key (id)
+    );
diff --git a/src/it/tutorials/schema-osgi-unmanaged-jpa.sql b/src/it/tutorials/schema-osgi-unmanaged-jpa.sql
new file mode 100644 (file)
index 0000000..66738bb
--- /dev/null
@@ -0,0 +1,8 @@
+
+    drop table DataPoint if exists;
+
+    create table DataPoint (
+        id bigint generated by default as identity,
+        name varchar(255),
+        primary key (id)
+    );
diff --git a/src/it/tutorials/schema-osgi-unmanaged-native.sql b/src/it/tutorials/schema-osgi-unmanaged-native.sql
new file mode 100644 (file)
index 0000000..3716535
--- /dev/null
@@ -0,0 +1,31 @@
+
+    drop table DataPoint if exists;
+
+    drop table DataPoint_AUD if exists;
+
+    drop table REVINFO if exists;
+
+    create table DataPoint (
+        id bigint generated by default as identity,
+        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 FK_7pdslro8w1n74eqwmorrn0hnb 
+        foreign key (REV) 
+        references REVINFO;
diff --git a/src/it/tutorials/verify.bsh b/src/it/tutorials/verify.bsh
new file mode 100644 (file)
index 0000000..4164d8b
--- /dev/null
@@ -0,0 +1,19 @@
+import de.juplo.test.FileComparator;
+
+
+FileComparator comparator = new FileComparator(basedir);
+
+if (!comparator.isEqual("schema-annotations.sql","annotations/target/schema.sql"))
+  return false;
+if (!comparator.isEqual("schema-basic.sql","basic/target/schema.sql"))
+  return false;
+if (!comparator.isEqual("schema-entitymanager.sql","entitymanager/target/schema.sql"))
+  return false;
+if (!comparator.isEqual("schema-envers.sql","envers/target/schema.sql"))
+  return false;
+if (!comparator.isEqual("schema-osgi-managed-jpa.sql","osgi/managed-jpa/target/schema.sql"))
+  return false;
+if (!comparator.isEqual("schema-osgi-unmanaged-jpa.sql","osgi/unmanaged-jpa/target/schema.sql"))
+  return false;
+if (!comparator.isEqual("schema-osgi-unmanaged-native.sql","osgi/unmanaged-native/target/schema.sql"))
+  return false;