Search in sources :

Example 51 with SchemaDefinition

use of org.jooq.util.SchemaDefinition in project jOOQ by jOOQ.

the class XMLTableDefinition method getElements0.

@Override
protected List<ColumnDefinition> getElements0() throws SQLException {
    List<ColumnDefinition> result = new ArrayList<ColumnDefinition>();
    for (Column column : info.getColumns()) {
        if (StringUtils.equals(table.getTableCatalog(), column.getTableCatalog()) && StringUtils.equals(table.getTableSchema(), column.getTableSchema()) && StringUtils.equals(table.getTableName(), column.getTableName())) {
            SchemaDefinition schema = getDatabase().getSchema(column.getTableSchema());
            DataTypeDefinition type = new DefaultDataTypeDefinition(getDatabase(), schema, column.getDataType(), unbox(column.getCharacterMaximumLength()), unbox(column.getNumericPrecision()), unbox(column.getNumericScale()), column.isIsNullable(), column.getColumnDefault());
            result.add(new DefaultColumnDefinition(this, column.getColumnName(), unbox(column.getOrdinalPosition()), type, column.getIdentityGeneration() != null, ""));
        }
    }
    return result;
}
Also used : SchemaDefinition(org.jooq.util.SchemaDefinition) Column(org.jooq.util.xml.jaxb.Column) DefaultDataTypeDefinition(org.jooq.util.DefaultDataTypeDefinition) DefaultColumnDefinition(org.jooq.util.DefaultColumnDefinition) ArrayList(java.util.ArrayList) DataTypeDefinition(org.jooq.util.DataTypeDefinition) DefaultDataTypeDefinition(org.jooq.util.DefaultDataTypeDefinition) ColumnDefinition(org.jooq.util.ColumnDefinition) DefaultColumnDefinition(org.jooq.util.DefaultColumnDefinition)

Aggregations

SchemaDefinition (org.jooq.util.SchemaDefinition)51 Record (org.jooq.Record)36 ArrayList (java.util.ArrayList)29 TableDefinition (org.jooq.util.TableDefinition)28 DefaultDataTypeDefinition (org.jooq.util.DefaultDataTypeDefinition)14 DataTypeDefinition (org.jooq.util.DataTypeDefinition)13 ColumnDefinition (org.jooq.util.ColumnDefinition)12 DefaultSequenceDefinition (org.jooq.util.DefaultSequenceDefinition)7 SequenceDefinition (org.jooq.util.SequenceDefinition)7 DefaultColumnDefinition (org.jooq.util.DefaultColumnDefinition)4 PgNamespace (org.jooq.util.postgres.pg_catalog.tables.PgNamespace)4 StringUtils.defaultString (org.jooq.tools.StringUtils.defaultString)3 RoutineDefinition (org.jooq.util.RoutineDefinition)3 KeyColumnUsage (org.jooq.util.xml.jaxb.KeyColumnUsage)3 Record6 (org.jooq.Record6)2 Schema (org.jooq.Schema)2 DefaultCheckConstraintDefinition (org.jooq.util.DefaultCheckConstraintDefinition)2 DefaultEnumDefinition (org.jooq.util.DefaultEnumDefinition)2 EnumDefinition (org.jooq.util.EnumDefinition)2 Columns (org.jooq.util.postgres.information_schema.tables.Columns)2