Skip to content

Commit

Permalink
Support joda in formatValueForAttribute on PostgresqlExpression
Browse files Browse the repository at this point in the history
  • Loading branch information
nullterminated committed Apr 23, 2012
1 parent cfc7394 commit 2958b3d
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 2958b3d

Please sign in to comment.