KeyColumnUsage.CONSTRAINT_SCHEMA.asc(),
KeyColumnUsage.CONSTRAINT_NAME.asc(),
KeyColumnUsage.ORDINAL_POSITION.asc())
.fetch()) {
SchemaDefinition foreignKeySchema = getSchema(record.getValue(ReferentialConstraints.CONSTRAINT_SCHEMA));
SchemaDefinition uniqueKeySchema = getSchema(record.getValue(ReferentialConstraints.UNIQUE_CONSTRAINT_SCHEMA));
String foreignKey = record.getValue(ReferentialConstraints.CONSTRAINT_NAME);
String foreignKeyColumn = record.getValue(KeyColumnUsage.COLUMN_NAME);
String foreignKeyTableName = record.getValue(ReferentialConstraints.TABLE_NAME);
String referencedKey = record.getValue(ReferentialConstraints.UNIQUE_CONSTRAINT_NAME);