Package org.hibernate.criterion

Examples of org.hibernate.criterion.Order


      crit.createCriteria("projekt", "proj");
      crit.add(Restrictions.not(Restrictions.eq("proj.projectIsArchived", true)));
    } else {
      crit.createCriteria("projekt", "proj");
    }
    Order order = Order.asc("titel");
    crit.addOrder(order);
    @SuppressWarnings("unchecked")
    List<Prozess> pl = crit.setFirstResult(0).setMaxResults(Integer.MAX_VALUE).list();

    HSSFWorkbook wb = new HSSFWorkbook();
View Full Code Here


    c.setFirstResult(pageRequest.getOffset());
    c.setMaxResults(pageRequest.getPageSize());

    if (pageRequest.isOrderBySetted()) {
      for (Sort sort : pageRequest.getSort()) {
        Order order = null;
        if (sort.getDir().equals(Sort.ASC)) {
          order = Order.asc(sort.getProperty());
        } else {
          order = Order.desc(sort.getProperty());
        }
View Full Code Here

  }

  private void sortList(Criteria inCrit) {
    inCrit.addOrder(Order.desc("prioritaet"));

    Order order = Order.asc("proc.titel");
    if (this.sortierung.equals("schrittAsc")) {
      order = Order.asc("titel");
    }
    if (this.sortierung.equals("schrittDesc")) {
      order = Order.desc("titel");
View Full Code Here

    return "ProzessverwaltungAlle";
  }

  private void sortList(Criteria inCrit, boolean addCriteria) {
    Order order = Order.asc("titel");
    if (this.sortierung.equals("titelAsc")) {
      order = Order.asc("titel");
    }
    if (this.sortierung.equals("titelDesc")) {
      order = Order.desc("titel");
View Full Code Here

   
    // Reset criteria after count
    detachedCriteria.setProjection(null);
    detachedCriteria.setResultTransformer(CriteriaSpecification.DISTINCT_ROOT_ENTITY);
    if (sorting != null) {
      Order order = null;
      if (sorting.isAscending()) {
        order = Order.asc(sorting.getSortingKey().getProperty());
      } else {
        order = Order.desc(sorting.getSortingKey().getProperty());
      }
View Full Code Here

           
            Criteria crit = session.createCriteria(clazz);
            if(orders != null) {
                Iterator it = orders.iterator();
                while(it.hasNext()){
                    Order order = (Order)it.next();
                    crit.addOrder(order);
                }
            }
           
           
View Full Code Here

        final Class<String>[] strClsArr = new Class[] { String.class };
        final Object[] objParam = new Object[1];

        for (final String string : orderCriteria) {
            tokens = string.split(":");
            Order order;
            try {
                objParam[0] = tokens[0];
                order = (Order) Order.class.getMethod(tokens[1], strClsArr).invoke(null, objParam);
            } catch (final Exception e) {
                throw new JournalException(e.getMessage(), e);
View Full Code Here

        Ordering ordering = sortField.getOrdering();
       
        if (Ordering.ASCENDING.equals(ordering) || Ordering.DESCENDING.equals(ordering)) {
          String propertyName = getPropertyName(context, sortField.getExpression());
         
          Order order = Ordering.ASCENDING.equals(ordering) ?
              Order.asc(propertyName) : Order.desc(propertyName);
             
          criteria.addOrder(order.ignoreCase());
        }
      }
    }
  }
View Full Code Here

            criteria.add(filterBy(filter));
        }

        if (!StringUtils.isEmpty(orderBy))
        {
            Order order = Order.asc(orderBy);
            if (desc)
            {
                order = Order.desc(orderBy);
            }
            criteria.addOrder(order);
View Full Code Here

            criteria.add(filterBy(filter));
        }

        if (!StringUtils.isEmpty(orderBy))
        {
            Order order = Order.asc(orderBy);
            if (desc)
            {
                order = Order.desc(orderBy);
            }
            criteria.addOrder(order);
View Full Code Here

TOP

Related Classes of org.hibernate.criterion.Order

Copyright © 2018 www.massapicom. 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.