public String buildQuery(String[] projectionIn,String selection,String groupBy,String having,String sortOrder,String limit){
  String[] projection=computeProjection(projectionIn);
  StringBuilder where=new StringBuilder();
  boolean hasBaseWhereClause=mWhereClause != null && mWhereClause.length() > 0;
  if (hasBaseWhereClause) {
    where.append(mWhereClause.toString());
    where.append(')');
  }
  if (selection != null && selection.length() > 0) {
    if (hasBaseWhereClause) {
      where.append(" AND ");
    }
    where.append('(');
    where.append(selection);
    where.append(')');
  }
  return buildQueryString(mDistinct,mTables,projection,where.toString(),groupBy,having,sortOrder,limit);
}

public String buildQuery ( String [ ] projectionIn , String selection , String groupBy , String having , String sortOrder , String limit ) { String [ ] projection = computeProjection ( projectionIn ) ; StringBuilder where = new StringBuilder ( ) ; boolean hasBaseWhereClause = mWhereClause != null && mWhereClause . length ( ) > 0 ; if ( hasBaseWhereClause ) { where . append ( mWhereClause . toString ( ) ) ; where . append ( ')' ) ; } if ( selection != null && selection . length ( ) > 0 ) { if ( hasBaseWhereClause ) { where . append ( " AND " ) ; } where . append ( '(' ) ; where . append ( selection ) ; where . append ( ')' ) ; } return buildQueryString ( mDistinct , mTables , projection , where . toString ( ) , groupBy , having , sortOrder , limit ) ; }
construct a select statement suitable for use in a group of select statements that will be joined through union operators in buildunionquery .
