private String parseInternal() { StringBuilder sb = new StringBuilder(); List<Property> properties = orderBy.getProperties(); if (properties.isEmpty()) { // order by clause removed by filterMany() return null; } for (int i = 0; i < properties.size(); i++) { if (i > 0) { sb.append(", "); } Property p = properties.get(i); String expression = parseProperty(p); sb.append(expression); } return sb.toString(); }
private List<OrmQueryProperties> removeQueryJoins() { List<OrmQueryProperties> queryJoins = detail.removeSecondaryQueries(); if (queryJoins != null) { if (orderBy != null) { // remove any orderBy properties that relate to // paths of the secondary queries for (OrmQueryProperties joinPath : queryJoins) { // loop through the orderBy properties and // move any ones related to the query join List<Property> properties = orderBy.getProperties(); Iterator<Property> it = properties.iterator(); while (it.hasNext()) { Property property = it.next(); if (property.getProperty().startsWith(joinPath.getPath())) { // remove this orderBy segment and // add it to the secondary join it.remove(); joinPath.addSecJoinOrderProperty(property); } } } } } return queryJoins; }
/** * Validate all the expression properties/paths given the bean descriptor. */ @Override public Set<String> validate(BeanType<T> desc) { SpiExpressionValidation validation = new SpiExpressionValidation(desc); if (whereExpressions != null) { whereExpressions.validate(validation); } if (havingExpressions != null) { havingExpressions.validate(validation); } if (orderBy != null) { for (Property property : orderBy.getProperties()) { validation.validate(property.getProperty()); } } return validation.getUnknownProperties(); }
private String parseInternal() { StringBuilder sb = new StringBuilder(); List<Property> properties = orderBy.getProperties(); if (properties.isEmpty()) { // order by clause removed by filterMany() return null; } for (int i = 0; i < properties.size(); i++) { if (i > 0) { sb.append(", "); } Property p = properties.get(i); String expression = parseProperty(p); sb.append(expression); } return sb.toString(); }
/** * <p>validate.</p> * * @param orderBy a {@link io.ebean.OrderBy} object. * @param validation a {@link ameba.db.ebean.internal.ListExpressionValidation} object. * @param ignoreUnknown a boolean. */ public static void validate(OrderBy<?> orderBy, ListExpressionValidation validation, boolean ignoreUnknown) { if (orderBy == null) return; Iterator<Property> it = orderBy.getProperties().iterator(); while (it.hasNext()) { validation.validate(it.next().getProperty()); if (ignoreUnknown && !validation.lastValid()) { it.remove(); } } }
private List<OrmQueryProperties> removeQueryJoins() { List<OrmQueryProperties> queryJoins = detail.removeSecondaryQueries(); if (queryJoins != null) { if (orderBy != null) { // remove any orderBy properties that relate to // paths of the secondary queries for (OrmQueryProperties joinPath : queryJoins) { // loop through the orderBy properties and // move any ones related to the query join List<Property> properties = orderBy.getProperties(); Iterator<Property> it = properties.iterator(); while (it.hasNext()) { Property property = it.next(); if (property.getProperty().startsWith(joinPath.getPath())) { // remove this orderBy segment and // add it to the secondary join it.remove(); joinPath.addSecJoinOrderProperty(property); } } } } } return queryJoins; }
/** * Validate all the expression properties/paths given the bean descriptor. */ @Override public Set<String> validate(BeanType<T> desc) { SpiExpressionValidation validation = new SpiExpressionValidation(desc); if (whereExpressions != null) { whereExpressions.validate(validation); } if (havingExpressions != null) { havingExpressions.validate(validation); } if (orderBy != null) { for (Property property : orderBy.getProperties()) { validation.validate(property.getProperty()); } } return validation.getUnknownProperties(); }