Search in sources :

Example 1 with DB2TableCheckConstraintColumn

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

the class DB2TableCheckConstraintCache method fetchObjectRow.

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

Aggregations

Nullable (org.jkiss.code.Nullable)1 DB2TableCheckConstraintColumn (org.jkiss.dbeaver.ext.db2.model.DB2TableCheckConstraintColumn)1 DB2TableColumn (org.jkiss.dbeaver.ext.db2.model.DB2TableColumn)1 DB2TableCheckConstraintColUsage (org.jkiss.dbeaver.ext.db2.model.dict.DB2TableCheckConstraintColUsage)1