Search in sources :

Example 1 with StringUtils.isBlank

use of org.jooq.tools.StringUtils.isBlank in project jOOQ by jOOQ.

the class AbstractDatabase method getInputSchemata.

@Override
public final List<String> getInputSchemata() {
    if (inputSchemataPerCatalog == null) {
        inputSchemata = new ArrayList<>();
        inputSchemataPerCatalog = new LinkedHashMap<>();
        // [#1312] Allow for omitting inputSchema configuration. Generate all schemata instead.
        if (configuredSchemata.size() == 1 && StringUtils.isBlank(configuredSchemata.get(0).getInputSchema())) {
            initAllSchemata();
        } else if (configuredCatalogs.size() == 1 && StringUtils.isBlank(configuredCatalogs.get(0).getInputCatalog()) && configuredCatalogs.get(0).getSchemata().size() == 1 && StringUtils.isBlank(configuredCatalogs.get(0).getSchemata().get(0).getInputSchema())) {
            initAllSchemata();
        } else if (configuredCatalogs.isEmpty()) {
            inputSchemataPerCatalog.put("", inputSchemata);
            for (SchemaMappingType schema : configuredSchemata) {
                {
                    inputSchemata.add(schema.getInputSchema());
                }
            }
        } else {
            for (CatalogMappingType catalog : configuredCatalogs) {
                for (SchemaMappingType schema : catalog.getSchemata()) {
                    String inputSchema;
                    {
                        inputSchema = schema.getInputSchema();
                    }
                    inputSchemata.add(inputSchema);
                    // [#6064] If no input catalogs were configured, we need to register the input schema for each catalog
                    for (String inputCatalog : (configuredCatalogs.size() == 1 && StringUtils.isBlank(configuredCatalogs.get(0).getInputCatalog())) ? getInputCatalogs() : Collections.singletonList(catalog.getInputCatalog())) {
                        inputSchemataPerCatalog.computeIfAbsent(inputCatalog, c -> new ArrayList<>()).add(inputSchema);
                    }
                }
            }
        }
    }
    return inputSchemata;
}
Also used : ForcedTypeObjectType(org.jooq.meta.jaxb.ForcedTypeObjectType) Arrays(java.util.Arrays) Connection(java.sql.Connection) DSL(org.jooq.impl.DSL) StringUtils.isBlank(org.jooq.tools.StringUtils.isBlank) ParseWithMetaLookups(org.jooq.conf.ParseWithMetaLookups) OnError(org.jooq.meta.jaxb.OnError) Table(org.jooq.Table) DSL.rowNumber(org.jooq.impl.DSL.rowNumber) DSL.when(org.jooq.impl.DSL.when) Condition(org.jooq.Condition) SyntheticViewType(org.jooq.meta.jaxb.SyntheticViewType) Matcher(java.util.regex.Matcher) CatalogMappingType(org.jooq.meta.jaxb.CatalogMappingType) Arrays.asList(java.util.Arrays.asList) Map(java.util.Map) Log(org.jooq.Log) DSLContext(org.jooq.DSLContext) BigInteger(java.math.BigInteger) CustomType(org.jooq.meta.jaxb.CustomType) SQLDialect(org.jooq.SQLDialect) Select(org.jooq.Select) AbstractTypedElementDefinition.customType(org.jooq.meta.AbstractTypedElementDefinition.customType) SyntheticIdentityType(org.jooq.meta.jaxb.SyntheticIdentityType) Nullability(org.jooq.meta.jaxb.Nullability) JooqLogger(org.jooq.tools.JooqLogger) Collections.emptyList(java.util.Collections.emptyList) Name(org.jooq.Name) CommentType(org.jooq.meta.jaxb.CommentType) DSL.falseCondition(org.jooq.impl.DSL.falseCondition) Collection(java.util.Collection) DSL.partitionBy(org.jooq.impl.DSL.partitionBy) Set(java.util.Set) ExecuteListener(org.jooq.ExecuteListener) Field(org.jooq.Field) CUBRID(org.jooq.SQLDialect.CUBRID) Meta(org.jooq.Meta) JDBCUtils(org.jooq.tools.jdbc.JDBCUtils) TableType(org.jooq.TableOptions.TableType) List(java.util.List) Stream(java.util.stream.Stream) TableField(org.jooq.TableField) SQLDataType(org.jooq.impl.SQLDataType) EmbeddableField(org.jooq.meta.jaxb.EmbeddableField) StringUtils.defaultIfNull(org.jooq.tools.StringUtils.defaultIfNull) Pattern(java.util.regex.Pattern) SchemaMappingType(org.jooq.meta.jaxb.SchemaMappingType) SyntheticObjectsType(org.jooq.meta.jaxb.SyntheticObjectsType) Query(org.jooq.Query) TRUE(java.lang.Boolean.TRUE) DetachedException(org.jooq.exception.DetachedException) DSL.count(org.jooq.impl.DSL.count) EnumType(org.jooq.meta.jaxb.EnumType) HashMap(java.util.HashMap) SyntheticReadonlyRowidType(org.jooq.meta.jaxb.SyntheticReadonlyRowidType) Supplier(java.util.function.Supplier) SyntheticReadonlyColumnType(org.jooq.meta.jaxb.SyntheticReadonlyColumnType) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) LinkedHashMap(java.util.LinkedHashMap) SyntheticForeignKeyType(org.jooq.meta.jaxb.SyntheticForeignKeyType) StringUtils.defaultIfEmpty(org.jooq.tools.StringUtils.defaultIfEmpty) SQLException(java.sql.SQLException) SQLITE(org.jooq.SQLDialect.SQLITE) Schema(org.jooq.Schema) Comparator.comparing(java.util.Comparator.comparing) SyntheticPrimaryKeyType(org.jooq.meta.jaxb.SyntheticPrimaryKeyType) Record(org.jooq.Record) DataAccessException(org.jooq.exception.DataAccessException) RegexFlag(org.jooq.meta.jaxb.RegexFlag) Properties(java.util.Properties) Iterator(java.util.Iterator) StringUtils.defaultIfBlank(org.jooq.tools.StringUtils.defaultIfBlank) IOException(java.io.IOException) ForcedType(org.jooq.meta.jaxb.ForcedType) FIREBIRD(org.jooq.SQLDialect.FIREBIRD) StringUtils(org.jooq.tools.StringUtils) SyntheticUniqueKeyType(org.jooq.meta.jaxb.SyntheticUniqueKeyType) File(java.io.File) ERROR(org.jooq.Log.Level.ERROR) DSL.one(org.jooq.impl.DSL.one) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) Param(org.jooq.Param) RenderQuotedNames(org.jooq.conf.RenderQuotedNames) Configuration(org.jooq.Configuration) ExecuteContext(org.jooq.ExecuteContext) DefaultExecuteListener(org.jooq.impl.DefaultExecuteListener) StringReader(java.io.StringReader) EmbeddableDefinitionType(org.jooq.meta.jaxb.EmbeddableDefinitionType) StopWatch(org.jooq.tools.StopWatch) CSVReader(org.jooq.tools.csv.CSVReader) Comparator(java.util.Comparator) Collections(java.util.Collections) MetaProvider(org.jooq.MetaProvider) CatalogMappingType(org.jooq.meta.jaxb.CatalogMappingType) SchemaMappingType(org.jooq.meta.jaxb.SchemaMappingType) ArrayList(java.util.ArrayList)

Aggregations

File (java.io.File)1 IOException (java.io.IOException)1 StringReader (java.io.StringReader)1 TRUE (java.lang.Boolean.TRUE)1 BigInteger (java.math.BigInteger)1 Connection (java.sql.Connection)1 SQLException (java.sql.SQLException)1 ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1 Arrays.asList (java.util.Arrays.asList)1 Collection (java.util.Collection)1 Collections (java.util.Collections)1 Collections.emptyList (java.util.Collections.emptyList)1 Comparator (java.util.Comparator)1 Comparator.comparing (java.util.Comparator.comparing)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 Iterator (java.util.Iterator)1 LinkedHashMap (java.util.LinkedHashMap)1 List (java.util.List)1