public String toAndroidWhere(){
  boolean hasWhere=Helper.isNotEmpty(mWhere);
  boolean hasGroup=Helper.isNotEmpty(mGroupBy);
  boolean hasHaving=Helper.isNotEmpty(mHaving);
  if (!hasWhere && !hasGroup && !hasHaving)   return null;
  StringBuilder result=new StringBuilder();
  if (!Helper.append(result,null,mWhere," AND ","(",")")) {
    result.append("1=1");
  }
  Helper.append(result,") GROUP BY (",mGroupBy,"), (","","");
  if (hasHaving) {
    Helper.append(result,") HAVING (",mHaving,"), (","","");
  }
  return result.toString();
}

public String toAndroidWhere ( ) { boolean hasWhere = Helper . isNotEmpty ( mWhere ) ; boolean hasGroup = Helper . isNotEmpty ( mGroupBy ) ; boolean hasHaving = Helper . isNotEmpty ( mHaving ) ; if ( ! hasWhere && ! hasGroup && ! hasHaving ) return null ; StringBuilder result = new StringBuilder ( ) ; if ( ! Helper . append ( result , null , mWhere , " AND " , "(" , ")" ) ) { result . append ( "1=1" ) ; } Helper . append ( result , ") GROUP BY (" , mGroupBy , "), (" , "" , "" ) ; if ( hasHaving ) { Helper . append ( result , ") HAVING (" , mHaving , "), (" , "" , "" ) ; } return result . toString ( ) ; }
android content - queries do not support group by . therefore this sql is added to the where part . [ select . . . from . . . where ( ] [ [ mwhere ] [ ) group by ( mgroupby ] [ ) having ( mhaving ] ] [ ) order by ] [ morderby ]
