@Override public OrderBy<T> order() { if (orderBy == null) { orderBy = new OrderBy<>(this, null); } return orderBy; }
@Override public DefaultOrmQuery<T> order(String orderByClause) { if (orderByClause == null || orderByClause.trim().isEmpty()) { this.orderBy = null; } else { this.orderBy = new OrderBy<>(this, orderByClause); } return this; }
/** * Return a copy of this OrderBy with the path trimmed. */ public OrderBy<T> copyWithTrim(String path) { List<Property> newList = new ArrayList<>(list.size()); for (Property aList : list) { newList.add(aList.copyWithTrim(path)); } return new OrderBy<>(newList); }
/** * Move a OrderBy.Property from the main query to this query join. */ @SuppressWarnings("rawtypes") void addSecJoinOrderProperty(OrderBy.Property orderProp) { if (orderBy == null) { orderBy = new OrderBy(); } orderBy.add(orderProp); }
/** * Return a copy of the OrderBy. */ public OrderBy<T> copy() { OrderBy<T> copy = new OrderBy<>(); for (Property aList : list) { copy.add(aList.copy()); } return copy; }
@Override public OrderBy<T> order() { if (orderBy == null) { orderBy = new OrderBy<>(this, null); } return orderBy; }
@Override public DefaultOrmQuery<T> order(String orderByClause) { if (orderByClause == null || orderByClause.trim().isEmpty()) { this.orderBy = null; } else { this.orderBy = new OrderBy<>(this, orderByClause); } return this; }
/** * Return a copy of this OrderBy with the path trimmed. */ public OrderBy<T> copyWithTrim(String path) { List<Property> newList = new ArrayList<>(list.size()); for (Property aList : list) { newList.add(aList.copyWithTrim(path)); } return new OrderBy<>(newList); }
/** * Move a OrderBy.Property from the main query to this query join. */ @SuppressWarnings("rawtypes") void addSecJoinOrderProperty(OrderBy.Property orderProp) { if (orderBy == null) { orderBy = new OrderBy(); } orderBy.add(orderProp); }
/** * Return a copy of the OrderBy. */ public OrderBy<T> copy() { OrderBy<T> copy = new OrderBy<>(); for (Property aList : list) { copy.add(aList.copy()); } return copy; }
/** * Convert spring data Sort to Ebean OrderBy. * * @param sort * @param <T> * @return */ public static <T> OrderBy<T> convertToEbeanOrderBy(Sort sort) { if (sort == null) { return null; } List<String> list = new ArrayList<>(); Iterator<Sort.Order> orderIterator = sort.iterator(); while (orderIterator.hasNext()) { Sort.Order so = orderIterator.next(); list.add(so.getProperty() + " " + so.getDirection()); } return new OrderBy<T>(StringUtils.collectionToCommaDelimitedString(list)); }
/** * Convert spring data Sort to Ebean OrderBy. * * @param sort * @param <T> * @return */ public static <T> OrderBy<T> convertToEbeanOrderBy(Sort sort) { if (sort == null) { return null; } List<String> list = new ArrayList<>(); Iterator<Sort.Order> orderIterator = sort.iterator(); while (orderIterator.hasNext()) { Sort.Order so = orderIterator.next(); list.add(so.getProperty() + " " + so.getDirection()); } return new OrderBy<T>(StringUtils.collectionToCommaDelimitedString(list)); }