Search in sources :

Example 1 with RoutineDefinition

use of org.jooq.meta.RoutineDefinition in project jOOQ by jOOQ.

the class JavaGenerator method generateUDT.

protected void generateUDT(UDTDefinition udt, JavaWriter out) {
    final SchemaDefinition schema = udt.getSchema();
    final PackageDefinition pkg = udt.getPackage();
    final boolean synthetic = udt.isSynthetic();
    final String className = getStrategy().getJavaClassName(udt);
    final String recordType = out.ref(getStrategy().getFullJavaClassName(udt, Mode.RECORD));
    final List<String> interfaces = out.ref(getStrategy().getJavaClassImplements(udt, Mode.DEFAULT));
    final String schemaId = out.ref(getStrategy().getFullJavaIdentifier(schema), 2);
    final String packageId = pkg == null ? null : out.ref(getStrategy().getFullJavaIdentifier(pkg), 2);
    final String udtId = out.ref(getStrategy().getJavaIdentifier(udt), 2);
    printPackage(out, udt);
    if (scala) {
        out.println("object %s {", className);
        printSingletonInstance(out, udt);
        for (AttributeDefinition attribute : udt.getAttributes()) {
            final String attrId = out.ref(getStrategy().getJavaIdentifier(attribute), 2);
            out.javadoc("The attribute <code>%s</code>.[[before= ][%s]]", attribute.getQualifiedOutputName(), list(escapeEntities(comment(attribute))));
            out.println("val %s = %s.%s", attrId, udtId, attrId);
        }
        out.println("}");
        out.println();
    }
    generateUDTClassJavadoc(udt, out);
    printClassAnnotations(out, udt, Mode.DEFAULT);
    if (scala) {
        out.println("%sclass %s extends %s[%s](\"%s\", null, %s, %s)[[before= with ][separator= with ][%s]] {", visibility(), className, UDTImpl.class, recordType, escapeString(udt.getOutputName()), packageId, synthetic, interfaces);
    } else if (kotlin) {
        out.println("%sopen class %s : %s<%s>(\"%s\", null, %s, %s)[[before=, ][%s]] {", visibility(), className, UDTImpl.class, recordType, escapeString(udt.getOutputName()), packageId, synthetic, interfaces);
        out.println();
        out.println("public companion object {");
        out.javadoc("The reference instance of <code>%s</code>", udt.getQualifiedOutputName());
        out.println("public val %s: %s = %s()", getStrategy().getJavaIdentifier(udt), className, className);
        out.println("}");
    } else {
        out.println("%sclass %s extends %s<%s>[[before= implements ][%s]] {", visibility(), className, UDTImpl.class, recordType, interfaces);
        out.printSerial();
        printSingletonInstance(out, udt);
    }
    printRecordTypeMethod(out, udt);
    for (AttributeDefinition attribute : udt.getAttributes()) {
        final String attrTypeFull = getJavaType(attribute.getType(resolver(out)), out);
        final String attrType = out.ref(attrTypeFull);
        final String attrTypeRef = getJavaTypeReference(attribute.getDatabase(), attribute.getType(resolver(out)), out);
        final String attrId = out.ref(getStrategy().getJavaIdentifier(attribute), 2);
        final String attrName = attribute.getName();
        final List<String> converter = out.ref(list(attribute.getType(resolver(out)).getConverter()));
        final List<String> binding = out.ref(list(attribute.getType(resolver(out)).getBinding()));
        if (!printDeprecationIfUnknownType(out, attrTypeFull))
            out.javadoc("The attribute <code>%s</code>.[[before= ][%s]]", attribute.getQualifiedOutputName(), list(escapeEntities(comment(attribute))));
        if (scala)
            out.println("private val %s: %s[%s, %s] = %s.createField(%s.name(\"%s\"), %s, this, \"%s\"" + converterTemplate(converter) + converterTemplate(binding) + ")", scalaWhitespaceSuffix(attrId), UDTField.class, recordType, attrType, UDTImpl.class, DSL.class, escapeString(attrName), attrTypeRef, escapeString(""), converter, binding);
        else if (kotlin)
            out.println("%sval %s: %s<%s, %s> = %s.createField(%s.name(\"%s\"), %s, this, \"%s\"" + converterTemplate(converter) + converterTemplate(binding) + ")", visibility(), attrId, UDTField.class, recordType, attrType, UDTImpl.class, DSL.class, escapeString(attrName), attrTypeRef, escapeString(""), converter, binding);
        else
            out.println("%sstatic final %s<%s, %s> %s = createField(%s.name(\"%s\"), %s, %s, \"%s\"" + converterTemplate(converter) + converterTemplate(binding) + ");", visibility(), UDTField.class, recordType, attrType, attrId, DSL.class, escapeString(attrName), attrTypeRef, udtId, escapeString(""), converter, binding);
    }
    // [#799] Oracle UDT's can have member procedures
    for (RoutineDefinition routine : udt.getRoutines()) {
        try {
            if (!routine.isSQLUsable()) {
                // Static execute() convenience method
                printConvenienceMethodProcedure(out, routine, false);
            } else {
                // Static execute() convenience method
                if (!routine.isAggregate())
                    printConvenienceMethodFunction(out, routine, false);
                // Static asField() convenience method
                printConvenienceMethodFunctionAsField(out, routine, false);
                printConvenienceMethodFunctionAsField(out, routine, true);
            }
        } catch (Exception e) {
            log.error("Error while generating routine " + routine, e);
        }
    }
    if (scala || kotlin) {
    } else {
        out.javadoc(NO_FURTHER_INSTANCES_ALLOWED);
        out.println("private %s() {", className);
        out.println("super(\"%s\", null, %s, %s);", udt.getOutputName(), packageId, synthetic);
        out.println("}");
    }
    if (scala) {
        out.println();
        out.println("%soverride def getSchema: %s = %s", visibilityPublic(), Schema.class, schemaId);
    } else if (kotlin) {
        out.println();
        out.println("%s override fun getSchema(): %s = %s", visibilityPublic(), Schema.class, schemaId);
    } else {
        out.overrideInherit();
        out.println("%s%s getSchema() {", visibilityPublic(), Schema.class);
        out.println("return %s != null ? %s : new %s(%s.name(\"%s\"));", schemaId, schemaId, SchemaImpl.class, DSL.class, schema.getOutputName());
        out.println("}");
    }
    generateUDTClassFooter(udt, out);
    out.println("}");
    closeJavaWriter(out);
}
Also used : RoutineDefinition(org.jooq.meta.RoutineDefinition) PostgresRoutineDefinition(org.jooq.meta.postgres.PostgresRoutineDefinition) SchemaDefinition(org.jooq.meta.SchemaDefinition) PackageDefinition(org.jooq.meta.PackageDefinition) Schema(org.jooq.Schema) LazySchema(org.jooq.impl.LazySchema) AttributeDefinition(org.jooq.meta.AttributeDefinition) IOException(java.io.IOException) SQLDialectNotSupportedException(org.jooq.exception.SQLDialectNotSupportedException) ReflectException(org.jooq.tools.reflect.ReflectException) SchemaImpl(org.jooq.impl.SchemaImpl) UDTImpl(org.jooq.impl.UDTImpl) UDTField(org.jooq.UDTField) DSL(org.jooq.impl.DSL)

Example 2 with RoutineDefinition

use of org.jooq.meta.RoutineDefinition in project jOOQ by jOOQ.

the class FirebirdDatabase method getRoutines0.

@Override
protected List<RoutineDefinition> getRoutines0() throws SQLException {
    Rdb$procedures p = RDB$PROCEDURES.as("p");
    Rdb$functions fu = RDB$FUNCTIONS.as("fu");
    Rdb$functionArguments fa = RDB$FUNCTION_ARGUMENTS.as("fa");
    Rdb$fields fi = RDB$FIELDS.as("fi");
    return create().select(p.RDB$PROCEDURE_NAME.trim(), inline(null, VARCHAR).as("t"), inline(null, SMALLINT).as("p"), inline(null, SMALLINT).as("s")).from(p).where(p.RDB$PROCEDURE_TYPE.eq((short) 2)).union(is30() ? select(fu.RDB$FUNCTION_NAME.trim(), FIELD_TYPE(fi).as("t"), coalesce(CHARACTER_LENGTH(fi), fi.RDB$FIELD_PRECISION).as("p"), FIELD_SCALE(fi).as("s")).from(fu).leftAntiJoin(p).on(fu.RDB$FUNCTION_NAME.eq(p.RDB$PROCEDURE_NAME)).join(fa).on(fu.RDB$FUNCTION_NAME.eq(fa.RDB$FUNCTION_NAME)).leftOuterJoin(fi).on(fa.RDB$FIELD_SOURCE.eq(fi.RDB$FIELD_NAME)).where(fa.RDB$ARGUMENT_POSITION.eq(inline((short) 0))) : select(inline(""), inline(""), inline((short) 0), inline((short) 0)).where(falseCondition())).orderBy(1).collect(mapping(r -> new FirebirdRoutineDefinition(getSchemata().get(0), r.get(0, String.class), r.get(1, String.class), r.get(2, Integer.class), r.get(3, Integer.class)), Collectors.<RoutineDefinition>toList()));
}
Also used : Arrays(java.util.Arrays) DSL(org.jooq.impl.DSL) DefaultIndexColumnDefinition(org.jooq.meta.DefaultIndexColumnDefinition) FIELD_SCALE(org.jooq.meta.firebird.FirebirdDatabase.FIELD_SCALE) DefaultDomainDefinition(org.jooq.meta.DefaultDomainDefinition) Rdb$functions(org.jooq.meta.firebird.rdb.tables.Rdb$functions) DefaultSequenceDefinition(org.jooq.meta.DefaultSequenceDefinition) DSL.when(org.jooq.impl.DSL.when) DataTypeDefinition(org.jooq.meta.DataTypeDefinition) Record4(org.jooq.Record4) BigDecimal(java.math.BigDecimal) RoutineDefinition(org.jooq.meta.RoutineDefinition) PackageDefinition(org.jooq.meta.PackageDefinition) RDB$FUNCTIONS(org.jooq.meta.firebird.rdb.Tables.RDB$FUNCTIONS) RDB$PROCEDURES(org.jooq.meta.firebird.rdb.Tables.RDB$PROCEDURES) IndexColumnDefinition(org.jooq.meta.IndexColumnDefinition) DSL.trim(org.jooq.impl.DSL.trim) Rdb$indices(org.jooq.meta.firebird.rdb.tables.Rdb$indices) Arrays.asList(java.util.Arrays.asList) RDB$REF_CONSTRAINTS(org.jooq.meta.firebird.rdb.Tables.RDB$REF_CONSTRAINTS) Map(java.util.Map) ResultQuery(org.jooq.ResultQuery) DSLContext(org.jooq.DSLContext) DSL.coalesce(org.jooq.impl.DSL.coalesce) SQLDialect(org.jooq.SQLDialect) SortOrder(org.jooq.SortOrder) Record6(org.jooq.Record6) SMALLINT(org.jooq.impl.SQLDataType.SMALLINT) RDB$TRIGGERS(org.jooq.meta.firebird.rdb.Tables.RDB$TRIGGERS) Rdb$checkConstraints(org.jooq.meta.firebird.rdb.tables.Rdb$checkConstraints) DSL.falseCondition(org.jooq.impl.DSL.falseCondition) Field(org.jooq.Field) DSL.select(org.jooq.impl.DSL.select) Result(org.jooq.Result) DSL.choose(org.jooq.impl.DSL.choose) Collectors(java.util.stream.Collectors) TableType(org.jooq.TableOptions.TableType) BOOLEAN(org.jooq.impl.SQLDataType.BOOLEAN) DomainDefinition(org.jooq.meta.DomainDefinition) List(java.util.List) INTEGER(org.jooq.impl.SQLDataType.INTEGER) SQLDataType(org.jooq.impl.SQLDataType) Rdb$triggers(org.jooq.meta.firebird.rdb.tables.Rdb$triggers) DSL.noCondition(org.jooq.impl.DSL.noCondition) Entry(java.util.Map.Entry) SchemaMappingType(org.jooq.meta.jaxb.SchemaMappingType) FirebirdDataType(org.jooq.util.firebird.FirebirdDataType) DefaultCheckConstraintDefinition(org.jooq.meta.DefaultCheckConstraintDefinition) AbstractIndexDefinition(org.jooq.meta.AbstractIndexDefinition) DefaultRelations(org.jooq.meta.DefaultRelations) RDB$INDEX_SEGMENTS(org.jooq.meta.firebird.rdb.Tables.RDB$INDEX_SEGMENTS) SequenceDefinition(org.jooq.meta.SequenceDefinition) RDB$RELATION_CONSTRAINTS(org.jooq.meta.firebird.rdb.Tables.RDB$RELATION_CONSTRAINTS) Rdb$procedures(org.jooq.meta.firebird.rdb.tables.Rdb$procedures) DefaultDataTypeDefinition(org.jooq.meta.DefaultDataTypeDefinition) Rdb$refConstraints(org.jooq.meta.firebird.rdb.tables.Rdb$refConstraints) DSL.decode(org.jooq.impl.DSL.decode) DSL.nullif(org.jooq.impl.DSL.nullif) RDB$RELATION_FIELDS(org.jooq.meta.firebird.rdb.Tables.RDB$RELATION_FIELDS) TableDefinition(org.jooq.meta.TableDefinition) IndexDefinition(org.jooq.meta.IndexDefinition) RDB$CHECK_CONSTRAINTS(org.jooq.meta.firebird.rdb.Tables.RDB$CHECK_CONSTRAINTS) ArrayList(java.util.ArrayList) SQLException(java.sql.SQLException) BIGINT(org.jooq.impl.SQLDataType.BIGINT) NUMERIC(org.jooq.impl.SQLDataType.NUMERIC) Collectors.mapping(java.util.stream.Collectors.mapping) VARCHAR(org.jooq.impl.SQLDataType.VARCHAR) ArrayDefinition(org.jooq.meta.ArrayDefinition) UDTDefinition(org.jooq.meta.UDTDefinition) DSL.inline(org.jooq.impl.DSL.inline) Record(org.jooq.Record) CHARACTER_LENGTH(org.jooq.meta.firebird.FirebirdDatabase.CHARACTER_LENGTH) RDB$RELATIONS(org.jooq.meta.firebird.rdb.Tables.RDB$RELATIONS) Rdb$indexSegments(org.jooq.meta.firebird.rdb.tables.Rdb$indexSegments) Rdb$relationConstraints(org.jooq.meta.firebird.rdb.tables.Rdb$relationConstraints) FIELD_TYPE(org.jooq.meta.firebird.FirebirdDatabase.FIELD_TYPE) Rdb$functionArguments(org.jooq.meta.firebird.rdb.tables.Rdb$functionArguments) RDB$FIELDS(org.jooq.meta.firebird.rdb.Tables.RDB$FIELDS) FIREBIRD(org.jooq.SQLDialect.FIREBIRD) StringUtils(org.jooq.tools.StringUtils) Rdb$fields(org.jooq.meta.firebird.rdb.tables.Rdb$fields) Record12(org.jooq.Record12) SchemaDefinition(org.jooq.meta.SchemaDefinition) DSL.max(org.jooq.impl.DSL.max) Tables(org.jooq.meta.firebird.rdb.Tables) DSL.any(org.jooq.impl.DSL.any) EnumDefinition(org.jooq.meta.EnumDefinition) RDB$INDICES(org.jooq.meta.firebird.rdb.Tables.RDB$INDICES) Collections(java.util.Collections) ResultQueryDatabase(org.jooq.meta.ResultQueryDatabase) AbstractDatabase(org.jooq.meta.AbstractDatabase) CatalogDefinition(org.jooq.meta.CatalogDefinition) RoutineDefinition(org.jooq.meta.RoutineDefinition) Rdb$functionArguments(org.jooq.meta.firebird.rdb.tables.Rdb$functionArguments) Rdb$fields(org.jooq.meta.firebird.rdb.tables.Rdb$fields) Rdb$functions(org.jooq.meta.firebird.rdb.tables.Rdb$functions) Rdb$procedures(org.jooq.meta.firebird.rdb.tables.Rdb$procedures)

Example 3 with RoutineDefinition

use of org.jooq.meta.RoutineDefinition in project jOOQ by jOOQ.

the class H2Database method getRoutines1_4.

private List<RoutineDefinition> getRoutines1_4() {
    List<RoutineDefinition> result = new ArrayList<>();
    Field<Boolean> overloaded = field(select(field(DSL.exists(select(one()).from(FUNCTION_ALIASES.as("a")).where(field(name("a", FUNCTION_ALIASES.ALIAS_SCHEMA.getName())).eq(FUNCTION_ALIASES.ALIAS_SCHEMA)).and(field(name("a", FUNCTION_ALIASES.ALIAS_NAME.getName())).eq(FUNCTION_ALIASES.ALIAS_NAME)).and(field(name("a", FUNCTION_ALIASES.COLUMN_COUNT.getName())).ne(FUNCTION_ALIASES.COLUMN_COUNT)))))).as("overloaded");
    for (Record record : create().select(FUNCTION_ALIASES.ALIAS_SCHEMA, FUNCTION_ALIASES.ALIAS_NAME, FUNCTION_ALIASES.REMARKS, FUNCTION_ALIASES.DATA_TYPE, FUNCTION_ALIASES.RETURNS_RESULT, FUNCTION_ALIASES.COLUMN_COUNT, overloaded, TYPE_INFO.TYPE_NAME, TYPE_INFO.PRECISION, TYPE_INFO.MAXIMUM_SCALE).from(FUNCTION_ALIASES).leftOuterJoin(TYPE_INFO).on(FUNCTION_ALIASES.DATA_TYPE.equal(TYPE_INFO.DATA_TYPE)).and(TYPE_INFO.POS.equal(0)).where(FUNCTION_ALIASES.ALIAS_SCHEMA.in(getInputSchemata())).and(FUNCTION_ALIASES.RETURNS_RESULT.in((short) 1, (short) 2)).orderBy(FUNCTION_ALIASES.ALIAS_NAME).fetch()) {
        SchemaDefinition schema = getSchema(record.get(FUNCTION_ALIASES.ALIAS_SCHEMA));
        if (schema != null) {
            String name = record.get(FUNCTION_ALIASES.ALIAS_NAME);
            String comment = record.get(FUNCTION_ALIASES.REMARKS);
            String typeName = record.get(TYPE_INFO.TYPE_NAME);
            Integer precision = record.get(TYPE_INFO.PRECISION);
            Short scale = record.get(TYPE_INFO.MAXIMUM_SCALE);
            String overload = record.get(overloaded) ? record.get(FUNCTION_ALIASES.COLUMN_COUNT, String.class) : null;
            result.add(new H2RoutineDefinition(schema, name, null, typeName, precision, scale, comment, overload));
        }
    }
    return result;
}
Also used : RoutineDefinition(org.jooq.meta.RoutineDefinition) SchemaDefinition(org.jooq.meta.SchemaDefinition) ArrayList(java.util.ArrayList) Record(org.jooq.Record)

Example 4 with RoutineDefinition

use of org.jooq.meta.RoutineDefinition in project jOOQ by jOOQ.

the class HSQLDBDatabase method getRoutines0.

@Override
protected List<RoutineDefinition> getRoutines0() throws SQLException {
    List<RoutineDefinition> result = new ArrayList<>();
    for (Record record : create().select(ROUTINES.ROUTINE_SCHEMA, ROUTINES.ROUTINE_NAME, ROUTINES.SPECIFIC_NAME, nvl(ELEMENT_TYPES.COLLECTION_TYPE_IDENTIFIER, ROUTINES.DATA_TYPE).as("datatype"), ROUTINES.NUMERIC_PRECISION, ROUTINES.NUMERIC_SCALE, field(ROUTINES.ROUTINE_DEFINITION.likeRegex(".*(?i:(\\w+\\s+)+aggregate\\s+function).*")).as("aggregate")).from(ROUTINES).leftOuterJoin(ELEMENT_TYPES).on(ROUTINES.ROUTINE_SCHEMA.equal(ELEMENT_TYPES.OBJECT_SCHEMA)).and(ROUTINES.ROUTINE_NAME.equal(ELEMENT_TYPES.OBJECT_NAME)).and(ROUTINES.DTD_IDENTIFIER.equal(ELEMENT_TYPES.COLLECTION_TYPE_IDENTIFIER)).where(ROUTINES.ROUTINE_SCHEMA.in(getInputSchemata())).and(tableValuedFunctions() ? ROUTINES.DATA_TYPE.isNull().or(ROUTINES.DATA_TYPE.notLike(inline("ROW(%"))) : noCondition()).orderBy(ROUTINES.ROUTINE_SCHEMA, ROUTINES.ROUTINE_NAME).fetch()) {
        String datatype = record.get("datatype", String.class);
        // [#3285] We currently do not recognise HSQLDB table-valued functions as such.
        if (datatype != null && datatype.toUpperCase().startsWith("ROW")) {
            JooqLogger.getLogger(getClass()).info("A row : " + datatype);
            datatype = "ROW";
        }
        result.add(new HSQLDBRoutineDefinition(getSchema(record.get(ROUTINES.ROUTINE_SCHEMA)), record.get(ROUTINES.ROUTINE_NAME), record.get(ROUTINES.SPECIFIC_NAME), datatype, record.get(ROUTINES.NUMERIC_PRECISION), record.get(ROUTINES.NUMERIC_SCALE), record.get("aggregate", boolean.class)));
    }
    return result;
}
Also used : RoutineDefinition(org.jooq.meta.RoutineDefinition) ArrayList(java.util.ArrayList) Record(org.jooq.Record)

Example 5 with RoutineDefinition

use of org.jooq.meta.RoutineDefinition in project jOOQ by jOOQ.

the class PostgresDatabase method getRoutines0.

@Override
protected List<RoutineDefinition> getRoutines0() throws SQLException {
    List<RoutineDefinition> result = new ArrayList<>();
    if (!canUseRoutines())
        return result;
    Routines r1 = ROUTINES.as("r1");
    // [#7785] The pg_proc.proisagg column has been replaced incompatibly in PostgreSQL 11
    Field<Boolean> isAgg = (is11() ? field(PG_PROC.PROKIND.eq(inline("a"))) : field("{0}.proisagg", SQLDataType.BOOLEAN, PG_PROC)).as("is_agg");
    return create().select(r1.ROUTINE_SCHEMA, r1.ROUTINE_NAME, r1.SPECIFIC_NAME, r1.ROUTINE_TYPE, when(r1.DATA_TYPE.eq(inline("USER-DEFINED")).and(r1.TYPE_UDT_NAME.eq(inline("geometry"))), inline("geometry")).else_(canCombineArrays() ? when(condition("{0} && ARRAY['o','b']::\"char\"[]", PG_PROC.PROARGMODES), inline("void")).else_(r1.DATA_TYPE) : r1.DATA_TYPE).as("data_type"), r1.CHARACTER_MAXIMUM_LENGTH, // [#12048] TODO: Maintain whether we know the precision or not
    when(r1.NUMERIC_PRECISION.isNull().and(r1.DATA_TYPE.in(inline("time"), inline("timetz"), inline("time without time zone"), inline("time with time zone"), inline("timestamp"), inline("timestamptz"), inline("timestamp without time zone"), inline("timestamp with time zone"))), inline(6)).else_(r1.NUMERIC_PRECISION).as(r1.NUMERIC_PRECISION), r1.NUMERIC_SCALE, r1.TYPE_UDT_SCHEMA, r1.TYPE_UDT_NAME, // Calculate overload index if applicable
    when(count().over(partitionBy(r1.ROUTINE_SCHEMA, r1.ROUTINE_NAME)).gt(one()), rowNumber().over(partitionBy(r1.ROUTINE_SCHEMA, r1.ROUTINE_NAME).orderBy(// replace(field("pg_get_function_arguments({0})", VARCHAR, PG_PROC.OID), inline('"'), inline("")),
    r1.SPECIFIC_NAME))).as("overload"), isAgg).from(r1).join(PG_NAMESPACE).on(PG_NAMESPACE.NSPNAME.eq(r1.SPECIFIC_SCHEMA)).join(PG_PROC).on(PG_PROC.PRONAMESPACE.eq(PG_NAMESPACE.OID)).and(is12() ? condition("nameconcatoid({0}, {1}) = {2}", PG_PROC.PRONAME, PG_PROC.OID, r1.SPECIFIC_NAME) : PG_PROC.PRONAME.concat("_").concat(PG_PROC.OID).eq(r1.SPECIFIC_NAME)).where(r1.ROUTINE_SCHEMA.in(getInputSchemata())).and(tableValuedFunctions() ? condition(not(PG_PROC.PRORETSET)) : noCondition()).and(!getIncludeTriggerRoutines() ? r1.DATA_TYPE.isDistinctFrom(inline("trigger")) : noCondition()).orderBy(r1.ROUTINE_SCHEMA.asc(), r1.ROUTINE_NAME.asc(), field(name("overload")).asc()).collect(mapping(r -> new PostgresRoutineDefinition(this, r), Collectors.<RoutineDefinition>toList()));
}
Also used : RoutineDefinition(org.jooq.meta.RoutineDefinition) Routines(org.jooq.meta.postgres.information_schema.tables.Routines) DSL(org.jooq.impl.DSL) DefaultIndexColumnDefinition(org.jooq.meta.DefaultIndexColumnDefinition) Records.intoList(org.jooq.Records.intoList) DefaultDomainDefinition(org.jooq.meta.DefaultDomainDefinition) DSL.field(org.jooq.impl.DSL.field) DefaultSequenceDefinition(org.jooq.meta.DefaultSequenceDefinition) DSL.condition(org.jooq.impl.DSL.condition) POSTGRES(org.jooq.SQLDialect.POSTGRES) DSL.when(org.jooq.impl.DSL.when) Condition(org.jooq.Condition) ColumnDefinition(org.jooq.meta.ColumnDefinition) BigDecimal(java.math.BigDecimal) Record5(org.jooq.Record5) RoutineDefinition(org.jooq.meta.RoutineDefinition) IndexColumnDefinition(org.jooq.meta.IndexColumnDefinition) Record1(org.jooq.Record1) Arrays.asList(java.util.Arrays.asList) Map(java.util.Map) DSL.values(org.jooq.impl.DSL.values) BigInteger(java.math.BigInteger) SQLDialect(org.jooq.SQLDialect) PG_INDEX(org.jooq.meta.postgres.pg_catalog.Tables.PG_INDEX) Record6(org.jooq.Record6) Select(org.jooq.Select) PG_ENUM(org.jooq.meta.postgres.pg_catalog.Tables.PG_ENUM) DSL.partitionBy(org.jooq.impl.DSL.partitionBy) PostgresDSL.arrayAppend(org.jooq.util.postgres.PostgresDSL.arrayAppend) Result(org.jooq.Result) TableType(org.jooq.TableOptions.TableType) BOOLEAN(org.jooq.impl.SQLDataType.BOOLEAN) TableField(org.jooq.TableField) SQLDataType(org.jooq.impl.SQLDataType) DSL.noCondition(org.jooq.impl.DSL.noCondition) ParserException(org.jooq.impl.ParserException) DOMAINS(org.jooq.meta.postgres.information_schema.Tables.DOMAINS) Records.mapping(org.jooq.Records.mapping) AbstractIndexDefinition(org.jooq.meta.AbstractIndexDefinition) SequenceDefinition(org.jooq.meta.SequenceDefinition) DefaultEnumDefinition(org.jooq.meta.DefaultEnumDefinition) DSL.not(org.jooq.impl.DSL.not) PgType(org.jooq.meta.postgres.pg_catalog.tables.PgType) PG_DESCRIPTION(org.jooq.meta.postgres.pg_catalog.Tables.PG_DESCRIPTION) TableDefinition(org.jooq.meta.TableDefinition) DSL.row(org.jooq.impl.DSL.row) IndexDefinition(org.jooq.meta.IndexDefinition) ArrayList(java.util.ArrayList) CHECK_CONSTRAINTS(org.jooq.meta.postgres.information_schema.Tables.CHECK_CONSTRAINTS) SQLException(java.sql.SQLException) DSL.sql(org.jooq.impl.DSL.sql) KEY_COLUMN_USAGE(org.jooq.meta.postgres.information_schema.Tables.KEY_COLUMN_USAGE) PgNamespace(org.jooq.meta.postgres.pg_catalog.tables.PgNamespace) VARCHAR(org.jooq.impl.SQLDataType.VARCHAR) Record(org.jooq.Record) PG_SEQUENCE(org.jooq.meta.postgres.pg_catalog.Tables.PG_SEQUENCE) TABLES(org.jooq.meta.postgres.information_schema.Tables.TABLES) Rows.toRowArray(org.jooq.Rows.toRowArray) PG_CONSTRAINT(org.jooq.meta.postgres.pg_catalog.Tables.PG_CONSTRAINT) SchemaDefinition(org.jooq.meta.SchemaDefinition) PG_TYPE(org.jooq.meta.postgres.pg_catalog.Tables.PG_TYPE) DSL.table(org.jooq.impl.DSL.table) AbstractDatabase(org.jooq.meta.AbstractDatabase) CatalogDefinition(org.jooq.meta.CatalogDefinition) PgIndex(org.jooq.meta.postgres.pg_catalog.tables.PgIndex) DSL.power(org.jooq.impl.DSL.power) COLUMNS(org.jooq.meta.postgres.information_schema.Tables.COLUMNS) VIEWS(org.jooq.meta.postgres.information_schema.Tables.VIEWS) PgInherits(org.jooq.meta.postgres.pg_catalog.tables.PgInherits) Table(org.jooq.Table) DSL.rowNumber(org.jooq.impl.DSL.rowNumber) DataTypeDefinition(org.jooq.meta.DataTypeDefinition) PackageDefinition(org.jooq.meta.PackageDefinition) PG_PROC(org.jooq.meta.postgres.pg_catalog.Tables.PG_PROC) ResultQuery(org.jooq.ResultQuery) DSLContext(org.jooq.DSLContext) PgClass(org.jooq.meta.postgres.pg_catalog.tables.PgClass) SortOrder(org.jooq.SortOrder) Routines(org.jooq.meta.postgres.information_schema.tables.Routines) DSL.name(org.jooq.impl.DSL.name) PG_INHERITS(org.jooq.meta.postgres.pg_catalog.Tables.PG_INHERITS) JooqLogger(org.jooq.tools.JooqLogger) KeyColumnUsage(org.jooq.meta.postgres.information_schema.tables.KeyColumnUsage) Name(org.jooq.Name) DSL.falseCondition(org.jooq.impl.DSL.falseCondition) Field(org.jooq.Field) DSL.select(org.jooq.impl.DSL.select) Collectors(java.util.stream.Collectors) PG_NAMESPACE(org.jooq.meta.postgres.pg_catalog.Tables.PG_NAMESPACE) PARAMETERS(org.jooq.meta.postgres.information_schema.Tables.PARAMETERS) DomainDefinition(org.jooq.meta.DomainDefinition) List(java.util.List) INTEGER(org.jooq.impl.SQLDataType.INTEGER) HSQLDBDatabase(org.jooq.meta.hsqldb.HSQLDBDatabase) PG_DEPEND(org.jooq.meta.postgres.pg_catalog.Tables.PG_DEPEND) SEQUENCES(org.jooq.meta.postgres.information_schema.Tables.SEQUENCES) DefaultCheckConstraintDefinition(org.jooq.meta.DefaultCheckConstraintDefinition) DefaultRelations(org.jooq.meta.DefaultRelations) DSL.count(org.jooq.impl.DSL.count) DefaultDataTypeDefinition(org.jooq.meta.DefaultDataTypeDefinition) DSL.decode(org.jooq.impl.DSL.decode) DSL.nullif(org.jooq.impl.DSL.nullif) HashMap(java.util.HashMap) ParseUnknownFunctions(org.jooq.conf.ParseUnknownFunctions) DSL.replace(org.jooq.impl.DSL.replace) DECIMAL_INTEGER(org.jooq.impl.SQLDataType.DECIMAL_INTEGER) PgConstraint(org.jooq.meta.postgres.pg_catalog.tables.PgConstraint) BIGINT(org.jooq.impl.SQLDataType.BIGINT) NUMERIC(org.jooq.impl.SQLDataType.NUMERIC) DSL.selectFrom(org.jooq.impl.DSL.selectFrom) Collectors.mapping(java.util.stream.Collectors.mapping) ArrayDefinition(org.jooq.meta.ArrayDefinition) UDTDefinition(org.jooq.meta.UDTDefinition) DSL.inline(org.jooq.impl.DSL.inline) CheckConstraints(org.jooq.meta.postgres.information_schema.tables.CheckConstraints) DataAccessException(org.jooq.exception.DataAccessException) ATTRIBUTES(org.jooq.meta.postgres.information_schema.Tables.ATTRIBUTES) DSL.cast(org.jooq.impl.DSL.cast) ForcedType(org.jooq.meta.jaxb.ForcedType) PG_CLASS(org.jooq.meta.postgres.pg_catalog.Tables.PG_CLASS) DSL.one(org.jooq.impl.DSL.one) ROUTINES(org.jooq.meta.postgres.information_schema.Tables.ROUTINES) Collectors.toList(java.util.stream.Collectors.toList) Record12(org.jooq.Record12) DSL.max(org.jooq.impl.DSL.max) DSL.array(org.jooq.impl.DSL.array) EnumDefinition(org.jooq.meta.EnumDefinition) ResultQueryDatabase(org.jooq.meta.ResultQueryDatabase) CommonTableExpression(org.jooq.CommonTableExpression) ArrayList(java.util.ArrayList)

Aggregations

RoutineDefinition (org.jooq.meta.RoutineDefinition)10 SchemaDefinition (org.jooq.meta.SchemaDefinition)8 ArrayList (java.util.ArrayList)7 Record (org.jooq.Record)6 PackageDefinition (org.jooq.meta.PackageDefinition)5 CatalogDefinition (org.jooq.meta.CatalogDefinition)4 Field (org.jooq.Field)3 Record6 (org.jooq.Record6)3 Result (org.jooq.Result)3 DSL (org.jooq.impl.DSL)3 ArrayDefinition (org.jooq.meta.ArrayDefinition)3 TableDefinition (org.jooq.meta.TableDefinition)3 IOException (java.io.IOException)2 BigDecimal (java.math.BigDecimal)2 SQLException (java.sql.SQLException)2 Arrays.asList (java.util.Arrays.asList)2 List (java.util.List)2 Map (java.util.Map)2 Collectors (java.util.stream.Collectors)2 Collectors.mapping (java.util.stream.Collectors.mapping)2