From fee05864d61145a06ee870fbffd3bff1e95af08c Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 15 Mar 2015 16:56:22 +0100 Subject: [PATCH] Extended integration-test "hib-test" to check for package-level annotations --- src/it/hib-test/h2.sql | 1 + src/it/hib-test/oracle.sql | 1 + src/it/hib-test/pom.xml | 10 ++++++++++ src/it/hib-test/postgres.sql | 1 + .../hibernate4/tests/SimplestMavenHib4Test.java | 5 +++++ .../juplo/plugins/hibernate4/tests/package-info.java | 2 ++ 6 files changed, 20 insertions(+) create mode 100644 src/it/hib-test/src/main/java/de/juplo/plugins/hibernate4/tests/package-info.java diff --git a/src/it/hib-test/h2.sql b/src/it/hib-test/h2.sql index 9569fa60..50da4e51 100644 --- a/src/it/hib-test/h2.sql +++ b/src/it/hib-test/h2.sql @@ -4,6 +4,7 @@ create table test_simple ( uuid varchar(36) not null, content clob, + created timestamp, externalid varchar(148), sources varchar(255), primary key (uuid) diff --git a/src/it/hib-test/oracle.sql b/src/it/hib-test/oracle.sql index c610b03f..37ad1074 100644 --- a/src/it/hib-test/oracle.sql +++ b/src/it/hib-test/oracle.sql @@ -4,6 +4,7 @@ create table test_simple ( uuid varchar2(36 char) not null, content clob, + created timestamp, externalid varchar2(148 char), sources varchar2(255 char), primary key (uuid) diff --git a/src/it/hib-test/pom.xml b/src/it/hib-test/pom.xml index 88dad6a6..fe46e321 100644 --- a/src/it/hib-test/pom.xml +++ b/src/it/hib-test/pom.xml @@ -15,6 +15,16 @@ hibernate-core 4.3.0.Final + + org.jadira.usertype + usertype.jodatime + 2.0.1 + + + joda-time + joda-time + 2.7 + diff --git a/src/it/hib-test/postgres.sql b/src/it/hib-test/postgres.sql index 875da31e..43c3d581 100644 --- a/src/it/hib-test/postgres.sql +++ b/src/it/hib-test/postgres.sql @@ -4,6 +4,7 @@ create table test_simple ( uuid varchar(36) not null, content text, + created timestamp, externalid varchar(148), sources varchar(255), primary key (uuid) diff --git a/src/it/hib-test/src/main/java/de/juplo/plugins/hibernate4/tests/SimplestMavenHib4Test.java b/src/it/hib-test/src/main/java/de/juplo/plugins/hibernate4/tests/SimplestMavenHib4Test.java index 3a3f565b..3e647471 100644 --- a/src/it/hib-test/src/main/java/de/juplo/plugins/hibernate4/tests/SimplestMavenHib4Test.java +++ b/src/it/hib-test/src/main/java/de/juplo/plugins/hibernate4/tests/SimplestMavenHib4Test.java @@ -7,6 +7,8 @@ import javax.persistence.Lob; import javax.persistence.Table; import org.hibernate.annotations.Index; +import org.hibernate.annotations.Type; +import org.joda.time.DateTime; @Entity @Table(name = "test_simple") @@ -29,4 +31,7 @@ public class SimplestMavenHib4Test { @Column(name = "externalid", length=148) private String externalXyzId; + + @Type(type = "joda") + private DateTime created; } diff --git a/src/it/hib-test/src/main/java/de/juplo/plugins/hibernate4/tests/package-info.java b/src/it/hib-test/src/main/java/de/juplo/plugins/hibernate4/tests/package-info.java new file mode 100644 index 00000000..23554cc4 --- /dev/null +++ b/src/it/hib-test/src/main/java/de/juplo/plugins/hibernate4/tests/package-info.java @@ -0,0 +1,2 @@ +@org.hibernate.annotations.TypeDef(name = "joda", typeClass = org.jadira.usertype.dateandtime.joda.PersistentDateTime.class) +package de.juplo.plugins.hibernate4.tests; -- 2.20.1