This whole function be simplified as:
```
String clause = hasAnd ? " AND " : ""; 
return clause + String.format(condition, column);
```