code: protected String genQueryString(final boolean hasOrder) {
      if (null == from) { return queryStr; }
      final StringBuilder buf = new StringBuilder(50);
      buf.append((select == null) ? "" : select).append(' ').append(from);
      if (!conditions.isEmpty()) {
        buf.append(" where ").append(Conditions.toQueryString(conditions));
      }
      if (!groups.isEmpty()) {
        buf.append(" group by ");
        for (final String groupBy : groups) {
          buf.append(groupBy).append(',');
        }
        buf.deleteCharAt(buf.length() - 1);
      }
      if (hasOrder && !CollectUtils.isEmpty(orders)) {
        buf.append(' ').append(Order.toSortString(orders));
      }
      return buf.toString();
    }
docs: <p>
  genQueryString.
  </p>
  
  @param hasOrder a boolean.
  @return a {@link java.lang.String} object.