Examples of Ordering


Examples of org.modeshape.jcr.query.model.Ordering

        PropertyExistence constraint = isPropertyExistence(query.constraint());
        assertThat(constraint.getPropertyName(), is("car:model"));
        assertThat(constraint.selectorName(), is(selectorName("car:Car")));
        // ORDER BY ...
        assertThat(query.orderings().size(), is(1));
        Ordering ordering = query.orderings().get(0);
        assertThat(ordering.order(), is(Order.ASCENDING));
        assertThat(ordering.getOperand(), is((DynamicOperand)propertyValue(selectorName("car:Car"), "car:model")));
    }
View Full Code Here

Examples of org.richfaces.model.Ordering

   
    for (Iterator<SortField2> iterator = sortFields.iterator(); iterator.hasNext() && result == 0;) {
      SortField2 field = iterator.next();
      Expression expression = field.getExpression();
      String prop = expression.getExpressionString();
      Ordering ordering = field.getOrdering();
      if (ordering != null) {
        Object p1 = w1.getProperty(prop);
        Object p2 = w2.getProperty(prop);
        if (p1 == p2 && p1 instanceof Comparator) {
          result = ((Comparator<Object>)p1).compare(w1.getWrappedObject(), w2.getWrappedObject());
        } else if (p1 instanceof String && p2 instanceof String) {
          if (stringComparator == null) {
            stringComparator = createStringComparator();
          }
          result = stringComparator.compare(((String)p1).trim(), ((String)p2).trim());
        } else if (p1 instanceof Comparable && p2 instanceof Comparable) {
          result = ((Comparable<Object>) p1).compareTo(p2);
        } else if (p1 == null && p2 != null) {
          result = 1;
        } else if (p2 == null && p1 != null) {
          result = -1;
        }
       
        if (ordering.equals(Ordering.DESCENDING)) {
          result = -result;
        }
      }
     
    }
View Full Code Here

Examples of org.richfaces.model.Ordering

  if (this._sortOrder != null) {
    return this._sortOrder;
  }
  ValueExpression ve = getValueExpression("sortOrder");
  if (ve != null) {
      Ordering value = null;
     
      try {
      value = (Ordering) ve.getValue(getFacesContext().getELContext());
      } catch (ELException e) {
      throw new FacesException(e);
View Full Code Here

Examples of org.richfaces.model.Ordering

        } else if (!name.startsWith(UIViewRoot.UNIQUE_ID_PREFIX)) {
          valueExpression = expressionFactory.createValueExpression(
              eLContext, "#{" + var + "." + name + "}",
              Object.class);
        }
        Ordering ordering = Ordering.UNSORTED;
        Boolean ascending = sortField.getAscending();
        if (ascending != null) {
          if (ascending) {
            ordering = Ordering.ASCENDING;
          } else {
View Full Code Here

Examples of org.richfaces.model.Ordering

  if (this._sortOrder != null) {
    return this._sortOrder;
  }
  ValueExpression ve = getValueExpression("sortOrder");
  if (ve != null) {
      Ordering value = null;
     
      try {
      value = (Ordering) ve.getValue(getFacesContext().getELContext());
      } catch (ELException e) {
      throw new FacesException(e);
View Full Code Here

Examples of org.richfaces.model.Ordering

  if (this._sortOrder != null) {
    return this._sortOrder;
  }
  ValueExpression ve = getValueExpression("sortOrder");
  if (ve != null) {
      Ordering value = null;
     
      try {
      value = (Ordering) ve.getValue(getFacesContext().getELContext());
      } catch (ELException e) {
      throw new FacesException(e);
View Full Code Here

Examples of org.richfaces.model.Ordering

  if (this._sortOrder != null) {
    return this._sortOrder;
  }
  ValueExpression ve = getValueExpression("sortOrder");
  if (ve != null) {
      Ordering value = null;
     
      try {
      value = (Ordering) ve.getValue(getFacesContext().getELContext());
      } catch (ELException e) {
      throw new FacesException(e);
View Full Code Here

Examples of org.richfaces.model.Ordering

  }
 
  public Ordering getSortOrder(){
    ValueExpression ve = getValueExpression("sortOrder");
    if (ve != null) {
        Ordering value = null;
        try {
        value = (Ordering) ve.getValue(getFacesContext().getELContext());
        } catch (ELException e) {
        throw new FacesException(e);
        }
View Full Code Here

Examples of org.richfaces.model.Ordering

  if (this._sortOrder != null) {
    return this._sortOrder;
  }
  ValueExpression ve = getValueExpression("sortOrder");
  if (ve != null) {
      Ordering value = null;
     
      try {
      value = (Ordering) ve.getValue(getFacesContext().getELContext());
      } catch (ELException e) {
      throw new FacesException(e);
View Full Code Here

Examples of org.richfaces.model.Ordering

  if (this._sortOrder != null) {
    return this._sortOrder;
  }
  ValueExpression ve = getValueExpression("sortOrder");
  if (ve != null) {
      Ordering value = null;
     
      try {
      value = (Ordering) ve.getValue(getFacesContext().getELContext());
      } catch (ELException e) {
      throw new FacesException(e);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.