public static void buildWhereClause(AbstractSqlPagingQueryProvider provider,boolean remainingPageQuery,StringBuilder sql){
  if (remainingPageQuery) {
    sql.append(" WHERE ");
    if (provider.getWhereClause() != null) {
      sql.append("(");
      sql.append(provider.getWhereClause());
      sql.append(") AND ");
    }
  }
 else {
    sql.append(provider.getWhereClause() == null ? "" : " WHERE " + provider.getWhereClause());
  }
}

public static void buildWhereClause ( AbstractSqlPagingQueryProvider provider , boolean remainingPageQuery , StringBuilder sql ) { if ( remainingPageQuery ) { sql . append ( " WHERE " ) ; if ( provider . getWhereClause ( ) != null ) { sql . append ( "(" ) ; sql . append ( provider . getWhereClause ( ) ) ; sql . append ( ") AND " ) ; } } else { sql . append ( provider . getWhereClause ( ) == null ? "" : " WHERE " + provider . getWhereClause ( ) ) ; } }
generates where clause for queries that require sub selects .
