From 2958b3d136fe945c037777c2c81bbb01870447d8 Mon Sep 17 00:00:00 2001 From: nullterminated Date: Mon, 23 Apr 2012 08:06:15 -0700 Subject: [PATCH] Support joda in formatValueForAttribute on PostgresqlExpression --- .../com/webobjects/jdbcadaptor/PostgresqlExpression.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Frameworks/PlugIns/PostgresqlPlugIn/Sources/com/webobjects/jdbcadaptor/PostgresqlExpression.java b/Frameworks/PlugIns/PostgresqlPlugIn/Sources/com/webobjects/jdbcadaptor/PostgresqlExpression.java index 9526a51fa05..5e24bf6d0f8 100644 --- a/Frameworks/PlugIns/PostgresqlPlugIn/Sources/com/webobjects/jdbcadaptor/PostgresqlExpression.java +++ b/Frameworks/PlugIns/PostgresqlPlugIn/Sources/com/webobjects/jdbcadaptor/PostgresqlExpression.java @@ -4,6 +4,7 @@ import java.lang.reflect.Method; import java.math.BigDecimal; import java.sql.Timestamp; +import java.util.Date; import java.util.Enumeration; import com.webobjects.eoaccess.EOAttribute; @@ -508,6 +509,11 @@ else if (!"bool".equals(eoattribute.externalType().toLowerCase()) && "NSNumber". // AK: I don't really like this, but we might want to prevent infinite recursion try { Object adaptorValue = eoattribute.adaptorValueByConvertingAttributeValue(obj); + if(adaptorValue instanceof Date && !(adaptorValue instanceof NSTimestamp)) { + //Support joda classes + Date date = (Date)adaptorValue; + adaptorValue = new NSTimestamp(date); + } if(adaptorValue instanceof NSData || adaptorValue instanceof NSTimestamp || adaptorValue instanceof String || adaptorValue instanceof Number || adaptorValue instanceof Boolean) {