Package org.jooq.util

Examples of org.jooq.util.ColumnDefinition


            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


                record.getValue(Columns.NUMERIC_PRECISION),
                record.getValue(Columns.NUMERIC_SCALE),
                record.getValue(Columns.IS_NULLABLE, boolean.class),
                record.getValue("default", boolean.class));

            ColumnDefinition column = new DefaultColumnDefinition(
              getDatabase().getTable(getSchema(), getName()),
                record.getValue(Columns.COLUMN_NAME),
                record.getValue(Columns.ORDINAL_POSITION),
                type,
                null != record.getValue(Columns.SEQUENCE_NAME),
View Full Code Here

                        "__" +
                        record.getValue("PK_NAME", String.class);

                    TableDefinition referencingTable = getTable(getSchemata().get(0), foreignKeyTableName);
                    if (referencingTable != null) {
                        ColumnDefinition column = referencingTable.getColumn(foreignKeyColumnName);
                        relations.addForeignKey(foreignKeyName, uniqueKeyName, column, getSchemata().get(0));
                    }
                }
            }
        }
View Full Code Here

                true,
                false,
                null
            );

      ColumnDefinition column = new DefaultColumnDefinition(
          getDatabase().getTable(getSchema(), getName()),
          record.getValue(p.PARAMETER_NAME),
          record.getValue(p.ORDINAL_POSITION),
          type,
          false,
View Full Code Here

                String table = tableDefinition.getInputName();
                String column = record.getValue("Field", String.class);
                String columnType = record.getValue("Type", String.class);
                String name = table + "_" + column;

                ColumnDefinition columnDefinition = tableDefinition.getColumn(column);

                // [#1137] Avoid generating enum classes for enum types that
                // are explicitly forced to another type
                if (getConfiguredForcedType(columnDefinition) == null) {
                    DefaultEnumDefinition definition = new DefaultEnumDefinition(getSchemata().get(0), name, "");
View Full Code Here

                record.getValue(COLUMNS.IS_NULLABLE, boolean.class),
                record.getValue(COLUMNS.COLUMN_DEFAULT) != null,
                record.getValue(COLUMNS.UDT_NAME)
            );

      ColumnDefinition column = new DefaultColumnDefinition(
          getDatabase().getTable(getSchema(), getName()),
          record.getValue(COLUMNS.COLUMN_NAME),
          record.getValue(COLUMNS.ORDINAL_POSITION, int.class),
          type,
          defaultString(record.getValue(COLUMNS.COLUMN_DEFAULT)).startsWith("nextval"),
View Full Code Here

            if (referencingTable != null) {

                // [#986] Add the table name as a namespace prefix to the key
                // name. In Postgres, foreign key names are only unique per table
                ColumnDefinition referencingColumn = referencingTable.getColumn(foreignKeyColumn);
                relations.addForeignKey(foreignKeyTable + "__" + foreignKey, uniqueKey, referencingColumn, uniqueKeySchema);
            }
        }
    }
View Full Code Here

            String fieldName = record.getValue(RDB$INDEX_SEGMENTS.RDB$FIELD_NAME.trim());
            String key = record.getValue(RDB$RELATION_CONSTRAINTS.RDB$CONSTRAINT_NAME.trim());

            TableDefinition td = getTable(this.getSchemata().get(0), tableName);
            if (td != null) {
                ColumnDefinition cd = td.getColumn(fieldName);
                r.addPrimaryKey(key, cd);
            }
        }
    }
View Full Code Here

            String fieldName = record.getValue(RDB$INDEX_SEGMENTS.RDB$FIELD_NAME.trim());
            String key = record.getValue(RDB$RELATION_CONSTRAINTS.RDB$CONSTRAINT_NAME.trim());

            TableDefinition td = getTable(this.getSchemata().get(0), tableName);
            if (td != null) {
                ColumnDefinition cd = td.getColumn(fieldName);
                r.addUniqueKey(key, cd);
            }
        }
    }
View Full Code Here

            TableDefinition tdReferencing = getTable(getSchemata().get(0), fkTable, true);
            TableDefinition tdReferenced = getTable(getSchemata().get(0), pkTable, true);

            if (tdReferenced != null && tdReferencing != null) {
                ColumnDefinition referencingColumn = tdReferencing.getColumn(fkField);
                relations.addForeignKey(fkName, pkName, referencingColumn, getSchemata().get(0));
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.jooq.util.ColumnDefinition

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.