Example:
@Override
protected boolean buildWhereClause(StringBuffer sqlBuffer, int noBindVars) {
// call ViewObjectImpl's buildWhereClause() to allow the framework to do its processing
boolean hasWhereClause = super.buildWhereClause(sqlBuffer, noBindVars);
if (hasWhereClause) { // framework added a WHERE clause
// modify the WHERE clause as needed
}
else { // framework did not add a WHERE clause, so we need to add it ourselves
// add a WHERE clause here
hasWhereClause = true; // ensure that is set to notify the framework
}
return hasWhereClause; // return true/false to indicate whether a WHERE clause was added
}
Context:
View Object Implementation