Package org.apache.empire.db

Examples of org.apache.empire.db.DBColumn


        final DBReference dbReference = references[0];
    assertEquals(dbReference.getSourceColumn(), employees.getColumn("DEPARTMENT_ID"));
        assertEquals(dbReference.getTargetColumn(), departments.getColumn("DEPARTMENT_ID"));
       
        final DBColumn salary = employees.getColumn("SALARY");

        assertThat(salary.getDataType(), is(DECIMAL));
        assertThat(salary.getSize(), is(121.212));
    }
View Full Code Here


        sql.append("COMMENT ON ");
        sql.append(type);
        sql.append(" ");
        if (expr instanceof DBColumn)
        {
            DBColumn c = (DBColumn)expr;
            c.getRowSet().addSQL(sql, DBExpr.CTX_NAME);
            sql.append(".");
        }
        expr.addSQL(sql, DBExpr.CTX_NAME);
        sql.append(" IS '");
        sql.append(comment);
View Full Code Here

        sql.append("COMMENT ON ");
        sql.append(type);
        sql.append(" ");
        if (expr instanceof DBColumn)
        {
            DBColumn c = (DBColumn)expr;
            c.getRowSet().addSQL(sql, DBExpr.CTX_NAME);
            sql.append(".");
        }
        expr.addSQL(sql, DBExpr.CTX_NAME);
        sql.append(" IS '");
        sql.append(comment);
View Full Code Here

               
                if (dbTable != null)
                {
                   
                    // check if the found column exists in the found DBTable
                    DBColumn col = dbTable.getColumn(columnName);
                    if (col == null)
                    {
                        log.warn("COLUMN NOT FOUND IN " + db.getClass().getName() + "\t: [" + tableName + "]["
                                       + columnName + "][" + dataType + "][" + dataLength + "]");
                        continue;
View Full Code Here

        DBDatabase db = t.getDatabase();
        createComment(db, "TABLE", t, t.getComment(), script);
        Iterator<DBColumn> columns = t.getColumns().iterator();
        while (columns.hasNext())
        {
            DBColumn c = columns.next();
            String com = c.getComment();
            if (com != null)
                createComment(db, "COLUMN", c, com, script);
        }
    }
View Full Code Here

    }
    // Foreign Key
    Map<DBColumn, DBColumn> referencesMap = t.getColumnReferences();
    if (referencesMap != null)
    {
      DBColumn source = null,target = null;
      for (Entry<DBColumn, DBColumn> entry : referencesMap.entrySet())
      {
        source = entry.getKey();
        target = entry.getValue();
        sql.append((addSeparator) ? ",\r\n   " : "\r\n   ");
        sql.append("FOREIGN KEY (");
        source.addSQL(sql, DBExpr.CTX_NAME);
        sql.append(") REFERENCES ");
        sql.append(target.getRowSet().getName());
        sql.append(" (");
        target.addSQL(sql, DBExpr.CTX_NAME);
        sql.append(")");
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

  private void gatherRelations(DBDatabase db, DatabaseMetaData dbMeta, ArrayList<String> tables) throws SQLException{
    ResultSet relations = null;
    String fkTableName, pkTableName, fkColName, pkColName, relName;
    DBTableColumn fkCol, pkCol;
    DBTable fkTable, pkTable;
    DBColumn col;
   
    // Add all Relations
    for (String tableName :tables) {
     
      // check for foreign-keys
View Full Code Here

        // add Comments
        createComment(db, "TABLE", t, t.getComment(), script);
        columns = t.getColumns().iterator();
        while (columns.hasNext())
        {
            DBColumn c = columns.next();
            String com = c.getComment();
            if (com != null)
                createComment(db, "COLUMN", c, com, script);
        }
        // done
        return success();
View Full Code Here

        sql.append("COMMENT ON ");
        sql.append(type);
        sql.append(" ");
        if (expr instanceof DBColumn)
        {
            DBColumn c = (DBColumn)expr;
            c.getRowSet().addSQL(sql, DBExpr.CTX_NAME);
            sql.append(".");
        }
        expr.addSQL(sql, DBExpr.CTX_NAME);
        sql.append(" IS '");
        sql.append(comment);
View Full Code Here

TOP

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

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.