use of com.infiniteautomation.mango.db.query.QueryComparison in project ma-core-public by infiniteautomation.
the class QueryModel method toString.
public String toString() {
StringBuilder builder = new StringBuilder();
for (QueryComparison c : andComparisons) {
builder.append(c.toString());
builder.append(" AND ");
}
for (QueryComparison c : orComparisons) {
builder.append(c.toString());
builder.append(" OR ");
}
if (sort.size() > 0) {
builder.append(" SORT ON ");
for (SortOption o : sort) {
builder.append(o.getAttribute());
if (o.isDesc()) {
builder.append(" DESC ");
} else {
builder.append(" ASC ");
}
}
}
if (limit != null) {
builder.append(" LIMIT ");
builder.append(limit);
}
return builder.toString();
}
Aggregations