Examples of orderBy()


Examples of javax.persistence.criteria.CriteriaQuery.orderBy()

        CriteriaBuilder cb = getEntityManager().getCriteriaBuilder();
        CriteriaQuery cq = cb.createQuery();
        Root<UserHD> z = cq.from(UserHD.class);
        Join<UserHD, Role> j = z.join(UserHD_.role);
        cq.where(cb.equal(j.get(Role_.name), RoleEnum.SERVICE));
        cq.orderBy(cb.asc(z.get(UserHD_.name)));
        cq.select(z);
       
        List<UserHD> l = getEntityManager().createQuery(cq).getResultList();
        return l;
    }
View Full Code Here

Examples of javax.persistence.criteria.CriteriaQuery.orderBy()

        CriteriaBuilder cb = getEntityManager().getCriteriaBuilder();
        CriteriaQuery cq = cb.createQuery();
        Root<UserHD> z = cq.from(UserHD.class);
        Join<UserHD, Role> j = z.join(UserHD_.role);
        cq.where(cb.equal(j.get(Role_.name), RoleEnum.CUSTOMER));
        cq.orderBy(cb.asc(z.get(UserHD_.name)));
        cq.select(z);
       
        List<UserHD> l = getEntityManager().createQuery(cq).getResultList();
        return l;
    }
View Full Code Here

Examples of javax.persistence.criteria.CriteriaQuery.orderBy()

        }
        CriteriaBuilder cb = getEntityManager().getCriteriaBuilder();
        CriteriaQuery cq = cb.createQuery();
        Root<UserHD> z = cq.from(UserHD.class);
        cq.where(cb.equal(z.get(UserHD_.organization), o));
        cq.orderBy(cb.asc(z.get(UserHD_.name)));
        cq.select(z);
       
        return getEntityManager().createQuery(cq).getResultList();
       
    }
View Full Code Here

Examples of javax.persistence.criteria.CriteriaQuery.orderBy()

   
    public List<Priority> findAll() {
        CriteriaBuilder cb = getEntityManager().getCriteriaBuilder();
        CriteriaQuery cq = cb.createQuery();
        Root<Priority> h = cq.from(Priority.class);
        cq.orderBy(cb.asc(h.get(Priority_.id)));
        return getEntityManager().createQuery(cq).getResultList();
    }

  
  
View Full Code Here

Examples of javax.persistence.criteria.CriteriaQuery.orderBy()

        } else {
            cq.where(cb.and(whereState, cb.or(whereCreatedBy, whereCreatedByOrg)));
        }
       
       
        cq.orderBy(cb.desc(z.get(Request_.id)));
        cq.select(z);

        return getEntityManager().createQuery(cq).getResultList();
    }       
   
View Full Code Here

Examples of javax.persistence.criteria.CriteriaQuery.orderBy()

        }
        CriteriaBuilder cb = getEntityManager().getCriteriaBuilder();
        CriteriaQuery cq = cb.createQuery();
        Root<HistoryRequest> h = cq.from(HistoryRequest.class);
        cq.where(cb.equal(h.get(HistoryRequest_.request), request));
        cq.orderBy(cb.desc(h.get(HistoryRequest_.modifiedDate)));
       
        cq.select(h);

        return em.createQuery(cq).getResultList();
    }
View Full Code Here

Examples of javax.persistence.criteria.CriteriaQuery.orderBy()

        CriteriaQuery cq = cb.createQuery();
        Root<ServiceObject> s = cq.from(ServiceObject.class);
       
        cq.where(cb.equal(s.get(ServiceObject_.organization), curUser.getOrganization()));
       
        cq.orderBy(cb.asc(s.get(ServiceObject_.id)));
        cq.select(s);
       
        return getEntityManager().createQuery(cq).getResultList();

       
View Full Code Here

Examples of org.apache.empire.db.DBCommand.orderBy()

    cmd.select(DEP.NAME.as("DEPARTMENT"));
    cmd.select(DEP.BUSINESS_UNIT);
    cmd.join(EMP.DEPARTMENT_ID, DEP.DEPARTMENT_ID);
        // Set constraints and order
        cmd.where(EMP.LASTNAME.length().isGreaterThan(0));
        cmd.orderBy(EMP.LASTNAME, EMP.FIRSTNAME);

        /*
        // Example for limitRows() and skipRows()
        if (db.getDriver().isSupported(DBDriverFeature.QUERY_LIMIT_ROWS))
        {  // set maximum number of rows
View Full Code Here

Examples of org.apache.empire.db.DBCommand.orderBy()

        cmd.select(DEP.NAME.as("DEPARTMENT"));
        cmd.select(DEP.BUSINESS_UNIT);
        cmd.join(EMP.DEPARTMENT_ID, DEP.DEPARTMENT_ID);
        // Set constraints and order
        cmd.where(EMP.LASTNAME.length().isGreaterThan(0));
        cmd.orderBy(EMP.LASTNAME, EMP.FIRSTNAME);

        /*
        // Example for limitRows() and skipRows()
        if (db.getDriver().isSupported(DBDriverFeature.QUERY_LIMIT_ROWS))
        {  // set maximum number of rows
View Full Code Here

Examples of org.apache.empire.db.DBCommand.orderBy()

        queryCmd.select(EMP.GENDER, EMP.DATE_OF_BIRTH, EMP.RETIRED);
        // queryCmd.select(EMP.RETIRED.decode(true, "X", "-"));
        queryCmd.select(DEPARTMENT);

        queryCmd.join(DEP.DEPARTMENT_ID, EMP.DEPARTMENT_ID);
        queryCmd.orderBy(EMP.FIRST_NAME);
       
        addAllConstraints(queryCmd);

        employees.initItems(queryCmd);
    }
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.