Search in sources :

Example 1 with DB2TableKeyColumn

use of org.jkiss.dbeaver.ext.db2.model.DB2TableKeyColumn in project dbeaver by serge-rider.

the class DB2TableForeignKeyCache method fetchObjectRow.

@Nullable
@Override
protected DB2TableKeyColumn[] fetchObjectRow(JDBCSession session, DB2Table db2Table, DB2TableForeignKey object, JDBCResultSet dbResult) throws SQLException, DBException {
    String colName = JDBCUtils.safeGetString(dbResult, "COLNAME");
    DB2TableColumn tableColumn = db2Table.getAttribute(session.getProgressMonitor(), colName);
    if (tableColumn == null) {
        log.debug("DB2TableForeignKeyCache : Column '" + colName + "' not found in table '" + db2Table.getFullyQualifiedName(DBPEvaluationContext.UI) + "' ??");
        return null;
    } else {
        return new DB2TableKeyColumn[] { new DB2TableKeyColumn(object, tableColumn, JDBCUtils.safeGetInt(dbResult, "COLSEQ")) };
    }
}
Also used : DB2TableKeyColumn(org.jkiss.dbeaver.ext.db2.model.DB2TableKeyColumn) DB2TableColumn(org.jkiss.dbeaver.ext.db2.model.DB2TableColumn) Nullable(org.jkiss.code.Nullable)

Example 2 with DB2TableKeyColumn

use of org.jkiss.dbeaver.ext.db2.model.DB2TableKeyColumn in project dbeaver by serge-rider.

the class DB2TableUniqueKeyCache method fetchObjectRow.

@Nullable
@Override
protected DB2TableKeyColumn[] fetchObjectRow(JDBCSession session, DB2Table db2Table, DB2TableUniqueKey object, JDBCResultSet dbResult) throws SQLException, DBException {
    String colName = JDBCUtils.safeGetString(dbResult, "COLNAME");
    DB2TableColumn tableColumn = db2Table.getAttribute(session.getProgressMonitor(), colName);
    if (tableColumn == null) {
        log.debug("Column '" + colName + "' not found in table '" + db2Table.getFullyQualifiedName(DBPEvaluationContext.UI) + "' ??");
        return null;
    } else {
        return new DB2TableKeyColumn[] { new DB2TableKeyColumn(object, tableColumn, JDBCUtils.safeGetInt(dbResult, "COLSEQ")) };
    }
}
Also used : DB2TableKeyColumn(org.jkiss.dbeaver.ext.db2.model.DB2TableKeyColumn) DB2TableColumn(org.jkiss.dbeaver.ext.db2.model.DB2TableColumn) Nullable(org.jkiss.code.Nullable)

Example 3 with DB2TableKeyColumn

use of org.jkiss.dbeaver.ext.db2.model.DB2TableKeyColumn in project dbeaver by serge-rider.

the class DB2TableReferenceCache method fetchObjectRow.

@Nullable
@Override
protected DB2TableKeyColumn[] fetchObjectRow(JDBCSession session, DB2Table db2Table, DB2TableReference db2TableReference, JDBCResultSet dbResult) throws SQLException, DBException {
    String colName = JDBCUtils.safeGetString(dbResult, "COLNAME");
    DB2TableColumn tableColumn = db2Table.getAttribute(session.getProgressMonitor(), colName);
    if (tableColumn == null) {
        log.debug("DB2TableReferenceCache : Column '" + colName + "' not found in table '" + db2Table.getName() + "' ??");
        return null;
    } else {
        return new DB2TableKeyColumn[] { new DB2TableKeyColumn(db2TableReference, tableColumn, JDBCUtils.safeGetInt(dbResult, "COLSEQ")) };
    }
}
Also used : DB2TableKeyColumn(org.jkiss.dbeaver.ext.db2.model.DB2TableKeyColumn) DB2TableColumn(org.jkiss.dbeaver.ext.db2.model.DB2TableColumn) Nullable(org.jkiss.code.Nullable)

Aggregations

Nullable (org.jkiss.code.Nullable)3 DB2TableColumn (org.jkiss.dbeaver.ext.db2.model.DB2TableColumn)3 DB2TableKeyColumn (org.jkiss.dbeaver.ext.db2.model.DB2TableKeyColumn)3