Package org.apache.empire.db

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


          EMP.C_FIRST_NAME.is(null)));
    if (StringUtils.isValid(employeeSearch.getLastName()))
      cmd.where(EMP.C_LAST_NAME.likeUpper(employeeSearch.getLastName()
          + "%"));

    cmd.orderBy(EMP.C_LAST_NAME);
    cmd.orderBy(EMP.C_FIRST_NAME);

    // set DataTable
    DBReader reader = new DBReader();
    try {
View Full Code Here

    if (StringUtils.isValid(employeeSearch.getLastName()))
      cmd.where(EMP.C_LAST_NAME.likeUpper(employeeSearch.getLastName()
          + "%"));

    cmd.orderBy(EMP.C_LAST_NAME);
    cmd.orderBy(EMP.C_FIRST_NAME);

    // set DataTable
    DBReader reader = new DBReader();
    try {
      reader.open(cmd, FacesUtils.getConnection());
View Full Code Here

            // STEP 7: read from Employee_Info_View
            System.out.println("--------------------------------------------------------");
            System.out.println("*** read from EMPLOYEE_INFO_VIEW ***");
            DBCommand cmd = db.createCommand();
            cmd.select (db.V_EMPLOYEE_INFO.getColumns());
            cmd.orderBy(db.V_EMPLOYEE_INFO.C_NAME_AND_DEP);
            printQueryResults(cmd, conn);

            // STEP 8: prepared Statement sample
            System.out.println("--------------------------------------------------------");
            System.out.println("*** commandParamsSample: shows how to use command parameters for the generation of prepared statements ***");
 
View Full Code Here

        cmd.join(T_EMP.C_EMPLOYEE_ID, T_EDH.C_EMPLOYEE_ID);
        cmd.join(T_DEP.C_DEPARTMENT_ID, T_EDH.C_DEPARTMENT_ID);
        // Set Constraints
        cmd.where(T_EMP.C_RETIRED.is(false));
        // Set Order
        cmd.orderBy(T_EMP.C_LASTNAME);
        cmd.orderBy(T_EMP.C_FIRSTNAME);

        // Query Records and print output
        printQueryResults(cmd, conn);
       
View Full Code Here

        cmd.join(T_DEP.C_DEPARTMENT_ID, T_EDH.C_DEPARTMENT_ID);
        // Set Constraints
        cmd.where(T_EMP.C_RETIRED.is(false));
        // Set Order
        cmd.orderBy(T_EMP.C_LASTNAME);
        cmd.orderBy(T_EMP.C_FIRSTNAME);

        // Query Records and print output
        printQueryResults(cmd, conn);
       
        // Define an updateable query
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.