/** * Return true if the property is known to be contained in the order by clause. */ public boolean containsProperty(String propertyName) { for (Property aList : list) { if (propertyName.equals(aList.getProperty())) { return true; } } return false; }
public 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 (int i = 0; i < queryJoins.size(); i++) { OrmQueryProperties joinPath = queryJoins.get(i); // 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()) { OrderBy.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; }
public 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 (int i = 0; i < queryJoins.size(); i++) { OrmQueryProperties joinPath = queryJoins.get(i); // 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()) { OrderBy.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; }
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 parseProperty(Property p) { String propName = p.getProperty(); ElPropertyValue el = desc.getElGetValue(propName); if (el == null){ return p.toStringFormat(); } BeanProperty beanProperty = el.getBeanProperty(); if (beanProperty instanceof BeanPropertyAssoc<?>){ BeanPropertyAssoc<?> ap = (BeanPropertyAssoc<?>)beanProperty; IdBinder idBinder = ap.getTargetDescriptor().getIdBinder(); return idBinder.getOrderBy(el.getElName(), p.isAscending()); } return p.toStringFormat(); } }
private String parseProperty(Property p) { String propName = p.getProperty(); ElPropertyValue el = desc.getElGetValue(propName); if (el == null) { return p.toStringFormat(); } BeanProperty beanProperty = el.getBeanProperty(); if (beanProperty instanceof BeanPropertyAssoc<?>) { BeanPropertyAssoc<?> ap = (BeanPropertyAssoc<?>) beanProperty; IdBinder idBinder = ap.getTargetDescriptor().getIdBinder(); return idBinder.getOrderBy(el.getElName(), p.isAscending()); } return p.toStringFormat(); } }
private String parseProperty(Property p) { String propName = p.getProperty(); ElPropertyValue el = desc.getElGetValue(propName); if (el == null){ return p.toStringFormat(); } BeanProperty beanProperty = el.getBeanProperty(); if (beanProperty instanceof BeanPropertyAssoc<?>){ BeanPropertyAssoc<?> ap = (BeanPropertyAssoc<?>)beanProperty; IdBinder idBinder = ap.getTargetDescriptor().getIdBinder(); return idBinder.getOrderBy(el.getElName(), p.isAscending()); } return p.toStringFormat(); } }