| 199 | } |
| 200 | |
| 201 | @Override |
| 202 | public String toString() { |
| 203 | StringBuilder result = new StringBuilder(); |
| 204 | result.append("SELECT "); |
| 205 | result.append("*"); |
| 206 | result.append(" FROM ").append("\"").append(table.getName()).append("\""); |
| 207 | if (whereBuilder != null && whereBuilder.getWhereItemSize() > 0) { |
| 208 | result.append(" WHERE ").append(whereBuilder.toString()); |
| 209 | } |
| 210 | if (orderByList != null && orderByList.size() > 0) { |
| 211 | result.append(" ORDER BY "); |
| 212 | for (OrderBy orderBy : orderByList) { |
| 213 | result.append(orderBy.toString()).append(','); |
| 214 | } |
| 215 | result.deleteCharAt(result.length() - 1); |
| 216 | } |
| 217 | if (limit > 0) { |
| 218 | result.append(" LIMIT ").append(limit); |
| 219 | result.append(" OFFSET ").append(offset); |
| 220 | } |
| 221 | return result.toString(); |
| 222 | } |
| 223 | |
| 224 | public static class OrderBy { |
| 225 | private String columnName; |