Package org.jooq.util

Examples of org.jooq.util.ColumnDefinition


                    // Generate a primary key name
                    String key = "pk_" + tableName;
                    TableDefinition table = getTable(getSchemata().get(0), tableName);

                    if (table != null) {
                        ColumnDefinition column = table.getColumn(columnName);
                        relations.addPrimaryKey(key, column);
                    }
                }
            }
        }
View Full Code Here


                if (referencedTable != null) {
                    String uniqueKey =
                        "pk_" + referencedTable.getName();

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

                scale,
                !record.getValue("notnull", boolean.class),
                record.getValue("dflt_value") != null
            );

            ColumnDefinition column = new DefaultColumnDefinition(
                getDatabase().getTable(getSchema(), getName()),
                name,
                position,
                type,
                identity,
View Full Code Here

                        String uniqueKey = constraint.getUniqueConstraintName();

                        TableDefinition referencingTable = getTable(foreignKeySchema, foreignKeyTable);

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

                scale,
                !parseNotNull(typeName),
                record.getValue(Syscolumns.COLUMNDEFAULT) != null
            );

      ColumnDefinition column = new DefaultColumnDefinition(
        getDatabase().getTable(getSchema(), getName()),
          record.getValue(Syscolumns.COLUMNNAME),
          record.getValue(Syscolumns.COLUMNNUMBER),
          type,
                null != record.getValue(Syscolumns.AUTOINCREMENTINC),
View Full Code Here

            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

            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

                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,
          null != record.getValue(COLUMNS.IDENTITY_GENERATION),
View Full Code Here

            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

                record.getValue(DB_ATTRIBUTE.IS_NULLABLE, boolean.class),
                record.getValue(DB_ATTRIBUTE.DEFAULT_VALUE) != null,
                getName() + "_" + record.getValue(DB_ATTRIBUTE.ATTR_NAME)
            );

      ColumnDefinition column = new DefaultColumnDefinition(
        getDatabase().getTable(getSchema(), getName()),
          record.getValue(DB_ATTRIBUTE.ATTR_NAME),
          record.getValue(DB_ATTRIBUTE.DEF_ORDER),
          type,
          record.getValue(DB_SERIAL.NAME) != null,
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.