Role data access/Personal lock sql where incorrect

Link to SF Tracker: http://sourceforge.net/support/tracker.php?aid=3030369
This commit is contained in:
phib 2011-03-25 23:43:01 -05:00
parent ad6b975ca1
commit a882c566d1
1 changed files with 11 additions and 6 deletions

View File

@ -2023,10 +2023,14 @@ public final class MRole extends X_AD_Role
} }
where.append(")"); where.append(")");
} }
else if (excludes.size() == 1) else if (excludes.size() == 1)
where.append(whereColumnName).append("<>").append(excludes.get(0)); {
where.append("(" + whereColumnName + " IS NULL OR ");
where.append(whereColumnName).append("<>").append(excludes.get(0)).append(")");
}
else if (excludes.size() > 1) else if (excludes.size() > 1)
{ {
where.append("(" + whereColumnName + " IS NULL OR ");
where.append(whereColumnName).append(" NOT IN ("); where.append(whereColumnName).append(" NOT IN (");
for (int ii = 0; ii < excludes.size(); ii++) for (int ii = 0; ii < excludes.size(); ii++)
{ {
@ -2034,7 +2038,7 @@ public final class MRole extends X_AD_Role
where.append(","); where.append(",");
where.append(excludes.get(ii)); where.append(excludes.get(ii));
} }
where.append(")"); where.append("))");
} }
log.finest(where.toString()); log.finest(where.toString());
return where.toString(); return where.toString();
@ -2324,8 +2328,9 @@ public final class MRole extends X_AD_Role
if (lockedIDs != null) if (lockedIDs != null)
{ {
if (sb.length() > 0) if (sb.length() > 0)
sb.append(" AND "); sb.append(" AND ");
sb.append(keyColumnName).append(lockedIDs); sb.append(" (" + keyColumnName + " IS NULL OR ");
sb.append(keyColumnName).append(lockedIDs).append(") ");
} }
} }
// //