Examples of desc()


Examples of javax.persistence.criteria.CriteriaBuilder.desc()

                    criteria.orderBy(builder.asc(propertyPath));
                    break;

                case DESCENDING:
                    criteria.orderBy(builder.desc(propertyPath));
                    break;

                default:
            }
        }
View Full Code Here

Examples of javax.persistence.criteria.CriteriaBuilder.desc()

        Path<?> path = root.get(mt.getSingularAttribute(item.getProperty()));
        Direction direction = item.getDirection();
        if (direction == Direction.ASC) {
          orderList.add(cb.asc(path));
        } else if (direction == Direction.DESC) {
          orderList.add(cb.desc(path));
        } else if (direction == Direction.ASC_TRUNC) {
          orderList.add(cb.asc(cb.function("trunc", Path.class, path)));
        } else if (direction == Direction.DESC_TRUNC) {
          orderList.add(cb.desc(cb.function("trunc", Path.class, path)));
        }
View Full Code Here

Examples of javax.persistence.criteria.CriteriaBuilder.desc()

        } else if (direction == Direction.DESC) {
          orderList.add(cb.desc(path));
        } else if (direction == Direction.ASC_TRUNC) {
          orderList.add(cb.asc(cb.function("trunc", Path.class, path)));
        } else if (direction == Direction.DESC_TRUNC) {
          orderList.add(cb.desc(cb.function("trunc", Path.class, path)));
        }
      }
      cq.orderBy(orderList);
    }
View Full Code Here

Examples of javax.persistence.criteria.CriteriaBuilder.desc()

        Entry<String, Direction> entry = iter.next();
        Path<?> path = evsr.get(mt.getSingularAttribute(entry.getKey()));
        if (entry.getValue() == Direction.ASC) {
          order.add(cb.asc(path));
        } else if (entry.getValue() == Direction.DESC) {
          order.add(cb.desc(path));
        }
      }
      cq.orderBy(order);
    }
View Full Code Here

Examples of javax.persistence.criteria.CriteriaBuilder.desc()

        cq.where(condition);
        cq.distinct(asc);
        if (asc) {
          cq.orderBy(cb.asc(c.get(orderby)));
        } else {
          cq.orderBy(cb.desc(c.get(orderby)));
        }
        TypedQuery<User> q = em.createQuery(cq);
        q.setFirstResult(start);
        q.setMaxResults(max);
        List<User> ll = q.getResultList();
View Full Code Here

Examples of javax.persistence.criteria.CriteriaBuilder.desc()

            {
                LOGGER.debug("(checkDbVersion) Creating version query");
                CriteriaBuilder cb = em.getCriteriaBuilder();
                CriteriaQuery<Version> cq = cb.createQuery(Version.class);
                Root<Version> versionRoot = cq.from(Version.class);
                cq.orderBy(cb.desc(versionRoot.get("id")));
                TypedQuery<Version> versionQuery = em.createQuery(cq);
                LOGGER.debug("(checkDbVersion) Query created");
                List<Version> versions = versionQuery.getResultList();
                LOGGER.debug("(checkDbVersion) Returned " + versions.size() +
                        " results.");
View Full Code Here

Examples of javax.persistence.criteria.CriteriaBuilder.desc()

                }
                criteriaQuery.where(predicate);
            }
            if (orderBy != null)
            {
                criteriaQuery.orderBy(ascending ? criteriaBuilder.asc(beanRoot.get(orderBy)) : criteriaBuilder.desc(beanRoot.get(orderBy)));
            }
           
            // invoke query
            Query query = entityManager.createQuery(criteriaQuery);
            List<? extends IBean> beansList = query.getResultList();
View Full Code Here

Examples of net.sourceforge.javautil.ui.command.annotation.Option.desc()

            this.addFlag(fla.name(), fla.value(), fla.defaultValue());
          }
        } else {
          Option opt = options[offset];
          defs.add(opt.name());
          this.addOption(opt.name(), type, opt.desc(), opt.defaultDesc());
        }
      } else {
        Argument arg = args[t];
        defs.add(arg.name());
        this.addArgument(arg.name(), type, arg.value());
View Full Code Here

Examples of net.sourceforge.javautil.ui.command.annotation.Option.desc()

   
    properties = descriptor.getProperties(Option.class);
    for (ClassProperty property : properties) {
      Option option = property.getAnnotation(Option.class);
      String name = "".equals(option) ? property.getName() : option.name();
      this.addOption(name, property.getType(), option.desc(), option.defaultDesc());
    }
   
    properties = descriptor.getProperties(Flag.class);
    for (ClassProperty property : properties) {
      Flag flag = property.getAnnotation(Flag.class);
View Full Code Here

Examples of org.activiti.engine.history.HistoricTaskInstanceQuery.desc()

          query.orderByHistoricTaskInstanceEndTime();
        }
        if(asc) {
          query.asc();
        } else {
          query.desc();
        }
        return query.list();
    }

    @Override
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.