Examples of SampleDB


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

  @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

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

  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

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

   
    @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

Examples of org.apache.empire.samples.cxf.wssample.server.db.SampleDB

     * init database, create tables if necessary ...
     */
    private void initDB()
    {
        config = new SampleConfig();
        db = new SampleDB();

        config.init(configPath);
        driver = getDatabaseDriver(config.getDatabaseProvider());
        conn = getJDBCConnection();

View Full Code Here

Examples of org.apache.empire.samples.cxf.wssample.server.db.SampleDB

     * init database, create tables if necessary ...
     */
    private void initDB()
    {
        config = new SampleConfig();
        db = new SampleDB();

        config.init(configPath);
        driver = getDatabaseDriver(config.getDatabaseProvider());
        conn = getJDBCConnection();

View Full Code Here

Examples of org.apache.empire.samples.cxf.wssample.server.db.SampleDB

     * init database, create tables if necessary ...
     */
    private void initDB()
    {
        config = new SampleConfig();
        db = new SampleDB();

        config.init(configPath);
        driver = getDatabaseDriver(config.getDatabaseProvider());
        conn = getJDBCConnection();

View Full Code Here

Examples of org.apache.empire.samples.cxf.wssample.server.db.SampleDB

     * init database, create tables if necessary ...
     */
    private void initDB()
    {
        config = new SampleConfig();
        db = new SampleDB();

        config.init(configPath);
        driver = getDatabaseDriver(config.getDatabaseProvider());
        conn = getJDBCConnection();

View Full Code Here

Examples of org.apache.empire.samples.spring.db.SampleDB

public class EmpireAppImpl extends EmpireDaoSupport implements EmpireApp {


    @Transactional
    public void clearDatabase() {
        SampleDB db = getDB();
        Connection conn = getConnection();

        DBCommand cmd = db.createCommand();
        // Delete all Employees (no constraints)
        db.executeSQL(cmd.getDelete(db.EMPLOYEES), conn);
        // Delete all Departments (no constraints)
        db.executeSQL(cmd.getDelete(db.DEPARTMENTS), conn);
    }
View Full Code Here

Examples of org.apache.empire.samples.spring.db.SampleDB

        db.executeSQL(cmd.getDelete(db.DEPARTMENTS), conn);
    }

    @Transactional
    public Integer insertDepartment(String departmentName, String businessUnit) {
        SampleDB db = getDB();
        Connection conn = getConnection();

        DBRecord rec = new DBRecord();
        rec.create(db.DEPARTMENTS);
        rec.setValue(db.DEPARTMENTS.NAME, departmentName);
View Full Code Here

Examples of org.apache.empire.samples.spring.db.SampleDB

        return rec.getInt(db.DEPARTMENTS.DEPARTMENT_ID);
    }

    @Transactional
    public Integer insertEmployee(String firstName, String lastName, String gender, int departmentId) {
        SampleDB db = getDB();
        Connection conn = getConnection();

        DBRecord rec = new DBRecord();
        rec.create(db.EMPLOYEES);
        rec.setValue(db.EMPLOYEES.FIRSTNAME, firstName);
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.