Examples of TableDefinition


Examples of org.jooq.util.TableDefinition

          String foreignKeyName = record.getValue(fkName);
            String foreignKeyTableName = record.getValue(fkTable);
            List<Integer> foreignKeyIndexes = decode(record.getValue(fkDescriptor, String.class));
            String uniqueKeyName = record.getValue(ukName);

          TableDefinition referencingTable = getTable(foreignKeySchema, foreignKeyTableName);
            if (referencingTable != null) {
                for (int i = 0; i < foreignKeyIndexes.size(); i++) {
                    ColumnDefinition column = referencingTable.getColumn(foreignKeyIndexes.get(i));

                    relations.addForeignKey(foreignKeyName, uniqueKeyName, column, uniqueKeySchema);
                }
            }
      }
View Full Code Here

Examples of org.jooq.util.TableDefinition

        for (UniqueKey<?> key : create().meta().getPrimaryKeys()) {
            Schema schema = key.getTable().getSchema();
            SchemaDefinition s = getSchema(schema == null ? "" : schema.getName());

            if (s != null) {
                TableDefinition t = getTable(s, key.getTable().getName());

                if (t != null) {
                    for (Field<?> field : key.getFields()) {
                        ColumnDefinition c = t.getColumn(field.getName());
                        relations.addPrimaryKey("PK_" + key.getTable().getName(), c);
                    }
                }
            }
        }
View Full Code Here

Examples of org.jooq.util.TableDefinition

            SchemaDefinition schema = getSchema(record.getValue(KEY_COLUMN_USAGE.TABLE_SCHEMA));
            String key = record.getValue(KEY_COLUMN_USAGE.CONSTRAINT_NAME);
            String tableName = record.getValue(KEY_COLUMN_USAGE.TABLE_NAME);
            String columnName = record.getValue(KEY_COLUMN_USAGE.COLUMN_NAME);

            TableDefinition table = getTable(schema, tableName);
            if (table != null) {
                relations.addPrimaryKey(key, table.getColumn(columnName));
            }
        }
    }
View Full Code Here

Examples of org.jooq.util.TableDefinition

            SchemaDefinition schema = getSchema(record.getValue(KEY_COLUMN_USAGE.TABLE_SCHEMA));
            String key = record.getValue(KEY_COLUMN_USAGE.CONSTRAINT_NAME);
            String tableName = record.getValue(KEY_COLUMN_USAGE.TABLE_NAME);
            String columnName = record.getValue(KEY_COLUMN_USAGE.COLUMN_NAME);

            TableDefinition table = getTable(schema, tableName);
            if (table != null) {
                relations.addUniqueKey(key, table.getColumn(columnName));
            }
        }
    }
View Full Code Here

Examples of org.jooq.util.TableDefinition

            String foreignKey = record.getValue(KEY_COLUMN_USAGE.CONSTRAINT_NAME);
            String foreignKeyTable = record.getValue(KEY_COLUMN_USAGE.TABLE_NAME);
            String foreignKeyColumn = record.getValue(KEY_COLUMN_USAGE.COLUMN_NAME);
            String uniqueKey = record.getValue(REFERENTIAL_CONSTRAINTS.UNIQUE_CONSTRAINT_NAME);

            TableDefinition referencingTable = getTable(foreignKeySchema, foreignKeyTable);

            if (referencingTable != null) {
                ColumnDefinition referencingColumn = referencingTable.getColumn(foreignKeyColumn);
                relations.addForeignKey(foreignKey, uniqueKey, referencingColumn, uniqueKeySchema);
            }
        }
    }
View Full Code Here

Examples of org.jooq.util.TableDefinition

                .using(tc.CONSTRAINT_CATALOG, tc.CONSTRAINT_SCHEMA, tc.CONSTRAINT_NAME)
                .where(tc.TABLE_SCHEMA.in(getInputSchemata()))
                .fetch()) {

            SchemaDefinition schema = getSchema(record.getValue(tc.TABLE_SCHEMA));
            TableDefinition table = getTable(schema, record.getValue(tc.TABLE_NAME));

            if (table != null) {
                relations.addCheckConstraint(table, new DefaultCheckConstraintDefinition(
                    schema,
                    table,
View Full Code Here

Examples of org.jooq.util.TableDefinition

            SchemaDefinition schema = getSchema(record.getValue(Constraints.TABLE_SCHEMA));
            String tableName = record.getValue(Constraints.TABLE_NAME);
            String primaryKey = record.getValue(Constraints.CONSTRAINT_NAME);
            String columnName = record.getValue(Indexes.COLUMN_NAME);

            TableDefinition table = getTable(schema, tableName);
            if (table != null) {
                relations.addPrimaryKey(primaryKey, table.getColumn(columnName));
            }
        }
    }
View Full Code Here

Examples of org.jooq.util.TableDefinition

            SchemaDefinition schema = getSchema(record.getValue(Constraints.TABLE_SCHEMA));
            String tableName = record.getValue(Constraints.TABLE_NAME);
            String primaryKey = record.getValue(Constraints.CONSTRAINT_NAME);
            String columnName = record.getValue(Indexes.COLUMN_NAME);

            TableDefinition table = getTable(schema, tableName);
            if (table != null) {
                relations.addUniqueKey(primaryKey, table.getColumn(columnName));
            }
        }
    }
View Full Code Here

Examples of org.jooq.util.TableDefinition

            String foreignKeyTableName = record.getValue(CrossReferences.FKTABLE_NAME);
            String foreignKeyColumn = record.getValue(CrossReferences.FKCOLUMN_NAME);
            String foreignKey = record.getValue(CrossReferences.FK_NAME);
            String uniqueKey = record.getValue(Constraints.CONSTRAINT_NAME);

            TableDefinition foreignKeyTable = getTable(foreignKeySchema, foreignKeyTableName);
            if (foreignKeyTable != null) {
                ColumnDefinition referencingColumn = foreignKeyTable.getColumn(foreignKeyColumn);

                relations.addForeignKey(foreignKey, uniqueKey, referencingColumn, uniqueKeySchema);
            }
        }
    }
View Full Code Here

Examples of org.jooq.util.TableDefinition

            .where(Columns.CHECK_CONSTRAINT.nvl("").ne(""))
            .and(Columns.TABLE_SCHEMA.in(getInputSchemata())))
            .fetch()) {

        SchemaDefinition schema = getSchema(record.getValue(Constraints.TABLE_SCHEMA));
        TableDefinition table = getTable(schema, record.getValue(Constraints.TABLE_NAME));

        if (table != null) {
            relations.addCheckConstraint(table, new DefaultCheckConstraintDefinition(
                schema,
                table,
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.