Skip to content

Commit

Permalink
Move to Hibernate 3.6, with flexible Joda-Time and Hibernate versioni…
Browse files Browse the repository at this point in the history
…ng (provided dependencies)

git-svn-id: https://joda-time.svn.sourceforge.net/svnroot/joda-time/trunk@1613 1e1cfbb7-5c0e-0410-a2f0-f98d92ec03a1
  • Loading branch information
jodastephen committed May 8, 2011
1 parent c8efa11 commit 266e7d9
Show file tree
Hide file tree
Showing 15 changed files with 214 additions and 119 deletions.
37 changes: 20 additions & 17 deletions .classpath
@@ -1,18 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" path="src/main/java"/> <classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="src" path="src/test/java"/> <classpathentry kind="src" path="src/test/java"/>
<classpathentry kind="var" path="MAVEN_REPO/junit/jars/junit-3.8.1.jar"/> <classpathentry kind="var" path="M2_REPO/javax/transaction/jta/1.1/jta-1.1.jar" sourcepath="M2_REPO/javax/transaction/jta/1.1/jta-1.1-sources.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="var" path="M2_REPO/antlr/antlr/2.7.6/antlr-2.7.6.jar" sourcepath="M2_REPO/antlr/antlr/2.7.6/antlr-2.7.6-sources.jar"/>
<classpathentry kind="var" path="MAVEN_REPO/hibernate/jars/hibernate-3.0.5.jar"/> <classpathentry kind="var" path="M2_REPO/asm/asm/3.1/asm-3.1.jar"/>
<classpathentry kind="var" path="MAVEN_REPO/commons-logging/jars/commons-logging-api-1.0.4.jar"/> <classpathentry kind="var" path="M2_REPO/cglib/cglib/2.2/cglib-2.2.jar" sourcepath="M2_REPO/cglib/cglib/2.2/cglib-2.2-sources.jar"/>
<classpathentry kind="var" path="MAVEN_REPO/commons-collections/jars/commons-collections-3.1.jar"/> <classpathentry kind="var" path="M2_REPO/commons-collections/commons-collections/3.1/commons-collections-3.1.jar" sourcepath="M2_REPO/commons-collections/commons-collections/3.1/commons-collections-3.1-sources.jar"/>
<classpathentry kind="var" path="MAVEN_REPO/hsqldb/jars/hsqldb-1.7.3.3.jar"/> <classpathentry kind="var" path="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar" sourcepath="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1-sources.jar"/>
<classpathentry kind="var" path="MAVEN_REPO/ehcache/jars/ehcache-1.1.jar"/> <classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-commons-annotations/3.2.0.Final/hibernate-commons-annotations-3.2.0.Final.jar"/>
<classpathentry kind="var" path="MAVEN_REPO/dom4j/jars/dom4j-1.6.jar"/> <classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-core/3.6.0.Final/hibernate-core-3.6.0.Final.jar"/>
<classpathentry kind="var" path="MAVEN_REPO/cglib/jars/cglib-full-2.0.2.jar"/> <classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-entitymanager/3.6.0.Final/hibernate-entitymanager-3.6.0.Final.jar" sourcepath="M2_REPO/org/hibernate/hibernate-entitymanager/3.6.0.Final/hibernate-entitymanager-3.6.0.Final-sources.jar"/>
<classpathentry kind="var" path="MAVEN_REPO/jta/jars/jta-1_0_1B-classes.zip"/> <classpathentry kind="var" path="M2_REPO/org/hibernate/javax/persistence/hibernate-jpa-2.0-api/1.0.0.Final/hibernate-jpa-2.0-api-1.0.0.Final.jar"/>
<classpathentry kind="var" path="MAVEN_REPO/joda-time/jars/joda-time-1.5.jar"/> <classpathentry kind="var" path="M2_REPO/hsqldb/hsqldb/1.7.3.3/hsqldb-1.7.3.3.jar"/>
<classpathentry kind="var" path="MAVEN_REPO/antlr/jars/antlr-2.7.2.jar"/> <classpathentry kind="var" path="M2_REPO/javassist/javassist/3.12.0.GA/javassist-3.12.0.GA.jar" sourcepath="M2_REPO/javassist/javassist/3.12.0.GA/javassist-3.12.0.GA-sources.jar"/>
<classpathentry kind="output" path="target/classes"/> <classpathentry kind="var" path="M2_REPO/joda-time/joda-time/1.6.2/joda-time-1.6.2.jar"/>
</classpath> <classpathentry kind="var" path="M2_REPO/junit/junit/3.8.2/junit-3.8.2.jar" sourcepath="M2_REPO/junit/junit/3.8.2/junit-3.8.2-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1.jar" sourcepath="M2_REPO/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1-sources.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
160 changes: 126 additions & 34 deletions pom.xml
Expand Up @@ -13,18 +13,15 @@
<url>http://joda-time.sourceforge.net/contrib/hibernate</url> <url>http://joda-time.sourceforge.net/contrib/hibernate</url>
<issueManagement> <issueManagement>
<system>Sourceforge</system> <system>Sourceforge</system>
<url>http://sourceforge.net/tracker/?atid=617889&amp;group_id=97367&amp;func=browse</url> <url>https://sourceforge.net/tracker/?group_id=97367&amp;atid=617889</url>
</issueManagement> </issueManagement>
<inceptionYear>2005</inceptionYear> <inceptionYear>2005</inceptionYear>
<mailingLists> <mailingLists>
<mailingList> <mailingList>
<name>Joda Interest list</name> <name>Joda Interest list</name>
<subscribe>http://lists.sourceforge.net/lists/listinfo/joda-interest</subscribe> <subscribe>https://lists.sourceforge.net/lists/listinfo/joda-interest</subscribe>
<unsubscribe>http://lists.sourceforge.net/lists/listinfo/joda-interest</unsubscribe> <unsubscribe>https://lists.sourceforge.net/lists/listinfo/joda-interest</unsubscribe>
<archive>http://sourceforge.net/mailarchive/forum.php?forum_name=joda-interest</archive> <archive>http://sourceforge.net/mailarchive/forum.php?forum_name=joda-interest</archive>
<otherArchives>
<otherArchive>http://n2.nabble.com/Joda-Interest-f219941.html</otherArchive>
</otherArchives>
</mailingList> </mailingList>
</mailingLists> </mailingLists>
<developers> <developers>
Expand Down Expand Up @@ -82,32 +79,55 @@
</resource> </resource>
</resources> </resources>
<plugins> <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>2.4.1</version>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.3.1</version>
<configuration> <configuration>
<verbose>true</verbose> <verbose>true</verbose>
<fork>true</fork> <fork>true</fork>
<executable>C:\java\jdk1.4.2\bin\javac</executable> <compilerVersion>1.5</compilerVersion>
<compilerVersion>1.4</compilerVersion> <source>1.5</source>
<target>1.5</target>
<debug>true</debug>
<debuglevel>lines,source</debuglevel>
<optimize>true</optimize>
<showDeprecation>false</showDeprecation>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.5</version>
<configuration> <configuration>
<includes> <includes>
<include>org/joda/time/contrib/hibernate/**/Test*.java</include> <include>org/joda/time/contrib/hibernate/**/Test*.java</include>
</includes> </includes>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<archive>
<manifestFile>src/conf/MANIFEST.MF</manifestFile>
</archive>
</configuration>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId> <artifactId>maven-javadoc-plugin</artifactId>
<version>2.6.1</version> <version>2.7</version>
<configuration> <configuration>
<linksource>true</linksource> <linksource>false</linksource>
<links> <links>
<link>http://java.sun.com/j2se/1.4.2/docs/api/</link> <link>http://download.oracle.com/javase/1.5.0/docs/api/</link>
<link>http://joda-time.sourceforge.net/api-release/</link> <link>http://joda-time.sourceforge.net/api-release/</link>
</links> </links>
<encoding>UTF-8</encoding> <encoding>UTF-8</encoding>
Expand All @@ -125,7 +145,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId> <artifactId>maven-source-plugin</artifactId>
<version>2.1.1</version> <version>2.1.2</version>
<executions> <executions>
<execution> <execution>
<id>attach-sources</id> <id>attach-sources</id>
Expand All @@ -138,22 +158,13 @@
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId> <artifactId>maven-site-plugin</artifactId>
<version>1.0-alpha-4</version> <version>2.1.1</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-repository-plugin</artifactId> <artifactId>maven-repository-plugin</artifactId>
<version>2.3</version> <version>2.3.1</version>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -181,12 +192,20 @@
<dependency> <dependency>
<groupId>joda-time</groupId> <groupId>joda-time</groupId>
<artifactId>joda-time</artifactId> <artifactId>joda-time</artifactId>
<version>1.5</version> <version>1.6.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.6.0.Final</version>
<scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.hibernate</groupId> <groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId> <artifactId>hibernate-entitymanager</artifactId>
<version>3.0.5</version> <version>3.6.0.Final</version>
<scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
Expand Down Expand Up @@ -224,7 +243,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId> <artifactId>maven-checkstyle-plugin</artifactId>
<version>2.1</version> <version>2.3</version>
<configuration> <configuration>
<configLocation>${basedir}/checkstyle.xml</configLocation> <configLocation>${basedir}/checkstyle.xml</configLocation>
<enableRulesSummary>false</enableRulesSummary> <enableRulesSummary>false</enableRulesSummary>
Expand All @@ -233,11 +252,11 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId> <artifactId>maven-javadoc-plugin</artifactId>
<version>2.6.1</version> <version>2.7</version>
<configuration> <configuration>
<linksource>true</linksource> <linksource>true</linksource>
<links> <links>
<link>http://java.sun.com/j2se/1.4.2/docs/api/</link> <link>http://download.oracle.com/javase/1.5.0/docs/api/</link>
<link>http://joda-time.sourceforge.net/api-release/</link> <link>http://joda-time.sourceforge.net/api-release/</link>
</links> </links>
<encoding>UTF-8</encoding> <encoding>UTF-8</encoding>
Expand All @@ -246,11 +265,16 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId> <artifactId>maven-surefire-report-plugin</artifactId>
<version>2.4.2</version> <version>2.5</version>
<configuration> <configuration>
<showSuccess>true</showSuccess> <showSuccess>true</showSuccess>
</configuration> </configuration>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.2</version>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-changes-plugin</artifactId> <artifactId>maven-changes-plugin</artifactId>
Expand All @@ -266,14 +290,13 @@
</reporting> </reporting>
<distributionManagement> <distributionManagement>
<repository> <repository>
<uniqueVersion>false</uniqueVersion>
<id>sonatype-joda-staging</id> <id>sonatype-joda-staging</id>
<name>Sonatype OSS staging repository</name> <name>Sonatype OSS staging repository</name>
<url>http://oss.sonatype.org/service/local/staging/deploy/maven2/</url> <url>http://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
<layout>default</layout> <layout>default</layout>
</repository> </repository>
<snapshotRepository> <snapshotRepository>
<uniqueVersion>true</uniqueVersion> <uniqueVersion>false</uniqueVersion>
<id>sonatype-joda-snapshot</id> <id>sonatype-joda-snapshot</id>
<name>Sonatype OSS snapshot repository</name> <name>Sonatype OSS snapshot repository</name>
<url>http://oss.sonatype.org/content/repositories/joda-snapshots</url> <url>http://oss.sonatype.org/content/repositories/joda-snapshots</url>
Expand All @@ -282,8 +305,77 @@
<site> <site>
<id>sf-web-joda-time-hibernate</id> <id>sf-web-joda-time-hibernate</id>
<name>Sourceforge Site</name> <name>Sourceforge Site</name>
<url>scp://shell.sourceforge.net/home/groups/j/jo/joda-time/htdocs/contrib/hibernate</url> <url>scp://shell.sourceforge.net/home/groups/j/jo/joda-time/htdocs/contrib/hibernate</url>
</site> </site>
<downloadUrl>http://oss.sonatype.org/content/repositories/joda-releases</downloadUrl> <downloadUrl>http://oss.sonatype.org/content/repositories/joda-releases</downloadUrl>
</distributionManagement> </distributionManagement>
<profiles>
<profile>
<id>repo-sign-artifacts</id>
<activation>
<property>
<name>oss.repo</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-toolchains-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>toolchain</goal>
</goals>
</execution>
</executions>
<configuration>
<toolchains>
<jdk>
<version>1.5</version>
<vendor>sun</vendor>
</jdk>
</toolchains>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Maven Repository Group</name>
<url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project> </project>
@@ -1,5 +1,5 @@
/* /*
* Copyright 2001-2009 Stephen Colebourne * Copyright 2001-2011 Stephen Colebourne
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
Expand All @@ -21,8 +21,8 @@
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Types; import java.sql.Types;


import org.hibernate.Hibernate;
import org.hibernate.HibernateException; import org.hibernate.HibernateException;
import org.hibernate.type.StandardBasicTypes;
import org.hibernate.usertype.UserType; import org.hibernate.usertype.UserType;


/** /**
Expand All @@ -37,7 +37,7 @@ public int[] sqlTypes() {
} }


public Object nullSafeGet(ResultSet resultSet, String[] strings, Object object) throws HibernateException, SQLException { public Object nullSafeGet(ResultSet resultSet, String[] strings, Object object) throws HibernateException, SQLException {
String s = (String) Hibernate.STRING.nullSafeGet(resultSet, strings[0]); String s = (String) StandardBasicTypes.STRING.nullSafeGet(resultSet, strings[0]);
if (s == null) { if (s == null) {
return null; return null;
} }
Expand All @@ -49,9 +49,9 @@ public Object nullSafeGet(ResultSet resultSet, String[] strings, Object object)


public void nullSafeSet(PreparedStatement preparedStatement, Object value, int index) throws HibernateException, SQLException { public void nullSafeSet(PreparedStatement preparedStatement, Object value, int index) throws HibernateException, SQLException {
if (value == null) { if (value == null) {
Hibernate.STRING.nullSafeSet(preparedStatement, null, index); StandardBasicTypes.STRING.nullSafeSet(preparedStatement, null, index);
} else { } else {
Hibernate.STRING.nullSafeSet(preparedStatement, toNonNullString(value), index); StandardBasicTypes.STRING.nullSafeSet(preparedStatement, toNonNullString(value), index);
} }
} }


Expand Down
@@ -1,5 +1,5 @@
/* /*
* Copyright 2001-2009 Stephen Colebourne * Copyright 2001-2011 Stephen Colebourne
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
Expand All @@ -21,8 +21,8 @@
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Types; import java.sql.Types;


import org.hibernate.Hibernate;
import org.hibernate.HibernateException; import org.hibernate.HibernateException;
import org.hibernate.type.StandardBasicTypes;
import org.hibernate.usertype.EnhancedUserType; import org.hibernate.usertype.EnhancedUserType;
import org.joda.time.DateTime; import org.joda.time.DateTime;


Expand Down Expand Up @@ -68,7 +68,7 @@ public Object nullSafeGet(ResultSet resultSet, String[] strings, Object object)
} }


public Object nullSafeGet(ResultSet resultSet, String string) throws SQLException { public Object nullSafeGet(ResultSet resultSet, String string) throws SQLException {
Object timestamp = Hibernate.TIMESTAMP.nullSafeGet(resultSet, string); Object timestamp = StandardBasicTypes.TIMESTAMP.nullSafeGet(resultSet, string);
if (timestamp == null) { if (timestamp == null) {
return null; return null;
} }
Expand All @@ -78,9 +78,9 @@ public Object nullSafeGet(ResultSet resultSet, String string) throws SQLExceptio


public void nullSafeSet(PreparedStatement preparedStatement, Object value, int index) throws HibernateException, SQLException { public void nullSafeSet(PreparedStatement preparedStatement, Object value, int index) throws HibernateException, SQLException {
if (value == null) { if (value == null) {
Hibernate.TIMESTAMP.nullSafeSet(preparedStatement, null, index); StandardBasicTypes.TIMESTAMP.nullSafeSet(preparedStatement, null, index);
} else { } else {
Hibernate.TIMESTAMP.nullSafeSet(preparedStatement, ((DateTime) value).toDate(), index); StandardBasicTypes.TIMESTAMP.nullSafeSet(preparedStatement, ((DateTime) value).toDate(), index);
} }
} }


Expand Down

0 comments on commit 266e7d9

Please sign in to comment.