all my member entries who have an ID equal to 64 and 61
I suspect the problem is that you want records where your ID is 64 OR 61. An ID cannot be both 64 AND 61 at the same time.
By trying to place two conflicting criteria on the same field you are replacing the first with the second.
I suggest you have a predicate for each element of the expression like a tree. e.g.
interface Predicate<T> {
boolean test(T t);
}
class EqualsColumnPredicate implement Predicate<ResultSet> {
final String columnName;
final Object value;
// create a constructor to set these
public boolean test(ResultSet rs) {
return rs.getObject(columnName).equals(value); // TODO check for nulls
}
}
class OrPredicate<T> implements Predicate<T> {
final Prediate<T>[] preciates;
// create a constructor for this field
public boolean test(T t) {
for(Predicate<T> p : predicates)
if(p.test(t)) return true;
return false;
}
}
Predicate<T> where = new OrPredicate<ResultSet>(
new EqualsColumnPredicate("column", 64),
new EqualsColumnPredicate("column", 61));
while(rs.next())
if (where.test(rs))
// found !!