OFBIZ-1266 patch from Jeremy Wickersheimer to fix issue with IN FALSE on some queries

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@755320 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Si Chen
2009-03-17 17:00:38 +00:00
parent 4a2df78fd1
commit b63fc30e8c
@@ -87,9 +87,9 @@ public class EntityComparisonOperator extends EntityOperator<Boolean> {
public void addSqlValue(StringBuilder sql, ModelEntity entity, List<EntityConditionParam> entityConditionParams, boolean compat, Object lhs, Object rhs, DatasourceInfo datasourceInfo) {
//Debug.logInfo("EntityComparisonOperator.addSqlValue field=" + lhs + ", value=" + rhs + ", value type=" + (rhs == null ? "null object" : rhs.getClass().getName()), module);
// if this is an IN operator and the rhs Object isEmpty, add "FALSE" instead of the normal SQL
// if this is an IN operator and the rhs Object isEmpty, add "1=0" instead of the normal SQL. Note that "FALSE" does not work with all databases.
if (this.idInt == EntityOperator.ID_IN && UtilValidate.isEmpty(rhs)) {
sql.append("FALSE");
sql.append("1=0");
return;
}