/** * 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 void enterOrderby_property(EQLParser.Orderby_propertyContext ctx) { int childCount = ctx.getChildCount(); String path = child(ctx, 0); boolean asc = true; String nulls = null; String nullsFirstLast = null; if (childCount == 3) { asc = child(ctx, 1).startsWith(ASC); nullsFirstLast = ctx.getChild(2).getChild(1).getText(); nulls = NULLS; } else if (childCount == 2) { String firstChild = child(ctx, 1); if (firstChild.startsWith(NULLS)) { nullsFirstLast = ctx.getChild(1).getChild(1).getText(); nulls = NULLS; } else { asc = firstChild.startsWith(ASC); } } query.orderBy().add(new OrderBy.Property(path, asc, nulls, nullsFirstLast)); }
/** * 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); }
/** * <p>appendOrder.</p> * * @param orderBy a {@link io.ebean.OrderBy} object. * @param orderByClause a {@link java.lang.String} object. * @param <T> a T object. */ public static <T> void appendOrder(OrderBy<T> orderBy, String orderByClause) { if (orderByClause == null) { return; } String[] chunks = orderByClause.split(","); for (String chunk : chunks) { String[] pairs = chunk.split(" "); Property p = parseOrderProperty(pairs); if (p != null) { orderBy.add(p); } } }
/** * 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 void enterOrderby_property(EQLParser.Orderby_propertyContext ctx) { int childCount = ctx.getChildCount(); String path = child(ctx, 0); boolean asc = true; String nulls = null; String nullsFirstLast = null; if (childCount == 3) { asc = child(ctx, 1).startsWith(ASC); nullsFirstLast = ctx.getChild(2).getChild(1).getText(); nulls = NULLS; } else if (childCount == 2) { String firstChild = child(ctx, 1); if (firstChild.startsWith(NULLS)) { nullsFirstLast = ctx.getChild(1).getChild(1).getText(); nulls = NULLS; } else { asc = firstChild.startsWith(ASC); } } query.orderBy().add(new OrderBy.Property(path, asc, nulls, nullsFirstLast)); }