value = e.formatValueForAttribute(value, attribute);
boolean isPostgres = e.getClass().getName().equals("com.webobjects.jdbcadaptor.PostgresqlExpression"); value = isPostgres ? e.formatValueForAttribute(value, attribute) : e.sqlStringForValue(value, key);
    public static String sqlWhereClauseStringForKey(EOSQLExpression e, String key, NSArray valueArray) {        if(valueArray.count() == 0) {            return "0=1";        }        StringBuffer sb = new StringBuffer();        EOAttribute attribute = e.entity().attributeNamed(key);        if (attribute == null) {            EORelationship relationship = e.entity().relationshipNamed(key);            if (relationship == null) { throw new IllegalArgumentException(key + " is neither an attribute nor a relationship of entity "                    + e.entity().name()); }            if (relationship.isFlattened()) {                //FIXME!            } else {                attribute = ((EOJoin) relationship.joins().lastObject()).sourceAttribute();            }        }        sb.append(e.sqlStringForAttribute(attribute));        sb.append(" IN ");        sb.append("(");        for (int i = 0; i < valueArray.count(); i++) {            if (i > 0) {                sb.append(", ");            }            Object value = valueArray.objectAtIndex(i);            value = e.formatValueForAttribute(value, attribute);            sb.append(value);        }        sb.append(")");        return sb.toString();    }