public WikittyQuery addSortAscending(ElementField ... field) { getSortAscending().addAll(Arrays.asList(field)); return this; }
if (!queryWithoutSelect.getSortAscending().isEmpty() || !queryWithoutSelect.getSortDescending().isEmpty() ) { Collections.sort(wikitties, new WikittyComparator( queryWithoutSelect.getSortAscending(), queryWithoutSelect.getSortDescending()));
List<Element> sortAscending = queryWithoutSelect.getSortAscending(); if(sortAscending != null) { for (Element sort : sortAscending) {
@Override public boolean equals(Object o) { boolean result; if (o == null) { result = false; } else if (ObjectUtils.equals(this.getClass(), o.getClass())) { WikittyQuery other = (WikittyQuery)o; result = ObjectUtils.equals(this.getName(), other.getName()) && ObjectUtils.equals(this.getOffset(), other.getOffset()) && ObjectUtils.equals(this.getLimit(), other.getLimit()) && ObjectUtils.equals(this.isFacetExtension(), other.isFacetExtension()) && ObjectUtils.equals(this.getFacetField(), other.getFacetField()) && ObjectUtils.equals(this.getSortAscending(), other.getSortAscending()) && ObjectUtils.equals(this.getSortDescending(), other.getSortDescending()) && ObjectUtils.equals(this.getFacetLimit(), other.getFacetLimit()) && ObjectUtils.equals(this.getFacetSort(), other.getFacetSort()) && ObjectUtils.equals(this.getFacetMinCount(), other.getFacetMinCount()) && ObjectUtils.equals(this.getFacetQuery(), other.getFacetQuery()) && ObjectUtils.equals(this.getCondition(), other.getCondition()) && ObjectUtils.equals(this.getWikittyFieldSearchDepth(), other.getWikittyFieldSearchDepth()); } else { result = false; } return result; }
@Override public boolean visitEnter(WikittyQuery o) { WikittyQuery q = getQuery(); q.setFacetExtension(q.isFacetExtension()); q.setFacetField(new ArrayList<Element>(o.getFacetField())); q.setFacetLimit(o.getFacetLimit()); q.setFacetMinCount(o.getFacetMinCount()); q.setOffset(o.getOffset()); q.setLimit(o.getLimit()); q.setFacetSort(o.getFacetSort()); q.setName(o.getName()); q.setSortAscending(new ArrayList<Element>(o.getSortAscending())); q.setSortDescending(new ArrayList<Element>(o.getSortDescending())); q.setWikittyFieldSearchDepth(o.getWikittyFieldSearchDepth()); for (FacetQuery c : o.getFacetQuery()) { WikittyQueryVisitorCopy v = new WikittyQueryVisitorCopy(); c.getCondition().accept(v); Condition condition = v.getCondition(); q.addFacetQuery(c.getName(), condition); } return true; }