Package org.apache.empire.db

Examples of org.apache.empire.db.DBColumnExpr


            return null; // Invalid Argument
        DBColumn[] keyCols = rowset.getKeyColumns();
        if (keyCols==null || keyCols.length==0)
            return null; // No Pimary key
        // Get Values
        DBColumnExpr expr = keyCols[0];
        for (int i=1; i<keyCols.length; i++)
        {
            expr = expr.append(KEY_SEP_CHAR).append(keyCols[i]);
        }
        if (aliasName==null || aliasName.length()==0)
            return expr;
        // Return expression
        return expr.as(aliasName);
    }
View Full Code Here


  @Override
  public void preRenderViewAction() {
    SampleDB sampleDB = FacesUtils.getDatabase();

    DBColumnExpr C_FULL_NAME = sampleDB.T_EMPLOYEES.C_LAST_NAME.append(", ")
        .append(sampleDB.T_EMPLOYEES.C_FIRST_NAME).as("NAME");
    DBColumnExpr C_DEPARTMENT = sampleDB.T_DEPARTMENTS.C_NAME
        .as("DEPARTMENT");
    // lade Liste aus der Datenbank

    SampleDB.Employees EMP = sampleDB.T_EMPLOYEES;
    SampleDB.Departments DEP = sampleDB.T_DEPARTMENTS;
View Full Code Here

     */
    private static void querySample(Connection conn, int employeeId)
    {
        // Define the sub query
        DBCommand subCmd = db.createCommand();
        DBColumnExpr MAX_DATE_FROM = T_EDH.C_DATE_FROM.max().as(T_EDH.C_DATE_FROM);
        subCmd.select(T_EDH.C_EMPLOYEE_ID, MAX_DATE_FROM);
        subCmd.groupBy(T_EDH.C_EMPLOYEE_ID);
        DBQuery Q_MAX_DATE = new DBQuery(subCmd);

        // Define the query
View Full Code Here

            // Print column titles
            System.out.println("---------------------------------");
            int count = reader.getFieldCount();
            for (int i=0; i<count; i++)
            {   // Print all column names
                DBColumnExpr c = reader.getColumnExpr(i);
                if (i>0)
                    System.out.print("\t");
                System.out.print(c.getName());
            }
            // Print output
            System.out.println("");
            // Text-Output by iterating through all records.
            while (reader.moveNext())
            {
                for (int i=0; i<count; i++)
                {   // Print all field values
                    if (i>0)
                        System.out.print("\t");
                    // Check if conversion is necessary
                    DBColumnExpr c = reader.getColumnExpr(i);
                    Options opt = c.getOptions();
                    if (opt!=null)
                    {   // Option Lookup
                        System.out.print(opt.get(reader.getValue(i)));
                    }
                    else
View Full Code Here

TOP

Related Classes of org.apache.empire.db.DBColumnExpr

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.