Search in sources :

Example 26 with DataTypeDefinition

use of org.jooq.util.DataTypeDefinition 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

DataTypeDefinition (org.jooq.util.DataTypeDefinition)26 DefaultDataTypeDefinition (org.jooq.util.DefaultDataTypeDefinition)25 ArrayList (java.util.ArrayList)19 Record (org.jooq.Record)19 SchemaDefinition (org.jooq.util.SchemaDefinition)13 ColumnDefinition (org.jooq.util.ColumnDefinition)10 DefaultColumnDefinition (org.jooq.util.DefaultColumnDefinition)10 DefaultParameterDefinition (org.jooq.util.DefaultParameterDefinition)7 DefaultSequenceDefinition (org.jooq.util.DefaultSequenceDefinition)7 SequenceDefinition (org.jooq.util.SequenceDefinition)7 ParameterDefinition (org.jooq.util.ParameterDefinition)6 StringUtils.defaultString (org.jooq.tools.StringUtils.defaultString)3 PgNamespace (org.jooq.util.postgres.pg_catalog.tables.PgNamespace)3 Columns (org.jooq.util.postgres.information_schema.tables.Columns)2 PgType (org.jooq.util.postgres.pg_catalog.tables.PgType)2 BigInteger (java.math.BigInteger)1 Name (org.jooq.Name)1 Schema (org.jooq.Schema)1 AttributeDefinition (org.jooq.util.AttributeDefinition)1 DefaultAttributeDefinition (org.jooq.util.DefaultAttributeDefinition)1