Package org.apache.empire.jsf2.websample.db

Examples of org.apache.empire.jsf2.websample.db.SampleDB


      TDepartments DEP = getDatabase().T_DEPARTMENTS;

      DBCommand queryCmd = createQueryCommand();
      queryCmd.select(DEP.DEPARTMENT_ID,DEP.NAME);
     
      SampleDB db = getDatabase();
        return db.queryOptionList(queryCmd.getSelect(), getConnection());
    }
View Full Code Here


    @Override
    public Options getFieldOptions(DBColumn column)
    {
        if (column.equals(T.DEPARTMENT_ID))
        {
            SampleDB db = (SampleDB) getDatabase();
            DBCommand cmd = db.createCommand();
            cmd.select(db.T_DEPARTMENTS.DEPARTMENT_ID);
            cmd.select(db.T_DEPARTMENTS.NAME);
            cmd.orderBy(db.T_DEPARTMENTS.NAME);
            return db.queryOptionList(cmd.getSelect(), SampleUtils.getConnection());
        }
        // base class implementation
        return super.getFieldOptions(column);
    }
View Full Code Here

  @Override
  public void preRenderViewAction() {
    if (employeeRecord == null) {
      employeeRecord = new EmployeeRecord();
      SampleDB sampleDB = FacesUtils.getDatabase();
      String id = FacesUtils.getHttpRequest().getParameter("id");
      if (id != null) {
        try {
          employeeRecord.read(sampleDB.T_EMPLOYEES,
              new String[] { id }, FacesUtils.getConnection());
View Full Code Here

  public EmployeeListPage() {
  }

  @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;

    DBCommand cmd = sampleDB.createCommand();
    cmd.select(EMP.C_EMPLOYEE_ID);
    cmd.select(C_FULL_NAME, EMP.C_GENDER, EMP.C_DATE_OF_BIRTH);
    cmd.select(C_DEPARTMENT);
    cmd.join(DEP.C_DEPARTMENT_ID, EMP.C_DEPARTMENT_ID);
View Full Code Here

   
    @Override
    public Options getFieldOptions(DBColumn column)
    {
        if (column.equals(T.C_DEPARTMENT_ID)) {
            SampleDB db = (SampleDB)getDatabase();
            DBCommand cmd = db.createCommand();
            cmd.select(db.T_DEPARTMENTS.C_DEPARTMENT_ID);
            cmd.select(db.T_DEPARTMENTS.C_NAME);
            return db.queryOptionList(cmd.getSelect(), FacesUtils.getConnection());
        }
        // base class implementation
        return super.getFieldOptions(column);
    }
View Full Code Here

        this.employees.clearItems();
    }
   
    public void doSearch()
    {
        TDepartments DEP = getDatabase().T_DEPARTMENTS;
        TEmployees EMP = getDatabase().T_EMPLOYEES;

        DBColumnExpr FULL_NAME = EMP.LAST_NAME.append(", ").append(EMP.FIRST_NAME).as("NAME");
        DBColumnExpr DEPARTMENT = DEP.NAME.as("DEPARTMENT");
View Full Code Here

    }


    public Options getDepartmentOptions()
    {
      TDepartments DEP = getDatabase().T_DEPARTMENTS;

      DBCommand queryCmd = createQueryCommand();
      queryCmd.select(DEP.DEPARTMENT_ID,DEP.NAME);
     
      SampleDB db = getDatabase();
View Full Code Here

        this.employees.clearItems();
    }
   
    public void doSearch()
    {
        TDepartments DEP = getDatabase().T_DEPARTMENTS;
        TEmployees EMP = getDatabase().T_EMPLOYEES;

        DBColumnExpr FULL_NAME = EMP.LAST_NAME.append(", ").append(EMP.FIRST_NAME).as("NAME");
        DBColumnExpr DEPARTMENT = DEP.NAME.as("DEPARTMENT");
View Full Code Here

    }


    public Options getDepartmentOptions()
    {
      TDepartments DEP = getDatabase().T_DEPARTMENTS;

      DBCommand queryCmd = createQueryCommand();
      queryCmd.select(DEP.DEPARTMENT_ID,DEP.NAME);
     
      SampleDB db = getDatabase();
View Full Code Here

    }

    public EmployeeListPage()
    {
        EmployeeListPage.log.trace("EmployeeListPage created");
        TEmployees EMP = getDatabase().T_EMPLOYEES;
       
        DBColumn defSortColumn = EMP.EMPLOYEE_ID;
        employees = new BeanListPageElement<EmployeeListEntry>(this, EmployeeListEntry.class, defSortColumn, EmployeeListPage.EMPLOYEES_PROPERTY);
    }
View Full Code Here

TOP

Related Classes of org.apache.empire.jsf2.websample.db.SampleDB

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.