Package org.jooq

Examples of org.jooq.Schema


        assertFalse(settings.isAttachRecords());
    }

    @Test
    public void testRenderSchema() {
        Schema schema = new SchemaImpl("S");
        Table<?> table = new TableImpl<Record>("T", schema);

        DSLContext create0 = DSL.using(SQLDialect.POSTGRES);
        assertEquals("\"S\".\"T\"", create0.render(table));
View Full Code Here


    }

    @Override
    protected void loadUniqueKeys(DefaultRelations relations) throws SQLException {
        for (UniqueKey<?> key : create().meta().getPrimaryKeys()) {
            Schema schema = key.getTable().getSchema();
            SchemaDefinition s = getSchema(schema == null ? "" : schema.getName());

            if (s != null) {
                TableDefinition t = getTable(s, key.getTable().getName());

                if (t != null) {
View Full Code Here

        if (qualifiedName.length < 1 || qualifiedName.length > 2)
            throw new IllegalArgumentException("Must provide a qualified name of length 1 or 2 : " + name(qualifiedName));

        String name = qualifiedName[qualifiedName.length - 1];
        Schema schema = qualifiedName.length == 2 ? schemaByName(qualifiedName[0]) : null;

        return new SequenceImpl<T>(name, schema, type);
    }
View Full Code Here

        return type;
    }

    @Override
    public final void accept(Context<?> ctx) {
        Schema mappedSchema = Utils.getMappedSchema(ctx.configuration(), getSchema());

        if (mappedSchema != null) {
            ctx.visit(mappedSchema);
            ctx.sql(".");
        }
View Full Code Here

        xx [/pro] */
        context.visit(value);
    }

    private final void toSQLQualifiedName(RenderContext context) {
        Schema mappedSchema = Utils.getMappedSchema(context.configuration(), getSchema());

        if (context.qualify()) {
            if (mappedSchema != null) {
                context.visit(mappedSchema);
                context.sql(".");
View Full Code Here

        Field<?> field = rs.result.field(column - 1);
        if (field instanceof TableField) {
            Table<?> table = ((TableField<?, ?>) field).getTable();

            if (table != null) {
                Schema schema = table.getSchema();

                if (schema != null) {
                    Configuration configuration = ((AttachableInternal) rs.result).configuration();
                    Schema mapped = null;

                    if (configuration != null) {
                        mapped = DSL.using(configuration).map(schema);
                    }

                    if (mapped != null) {
                        return mapped.getName();
                    }
                    else {
                        return schema.getName();
                    }
                }
View Full Code Here

        if (alias != null) {
            alias.accept(ctx);
        }
        else {
            if (ctx.qualify()) {
                Schema mappedSchema = Utils.getMappedSchema(ctx.configuration(), getSchema());

                if (mappedSchema != null) {
                    ctx.visit(mappedSchema);
                    ctx.sql(".");
                }
View Full Code Here

            xx [/pro] */

            // Assume default behaviour if dialect is not available
            default: {
                UDT<?> udt = value.getUDT();
                Schema mappedSchema = Utils.getMappedSchema(context.configuration(), udt.getSchema());

                if (mappedSchema != null) {
                    return mappedSchema + "." + udt.getName();
                }
                else {
View Full Code Here

        }
    }

    private final String getQualifiedName(Configuration configuration) {
        RenderContext local = create(configuration).renderContext();
        Schema mappedSchema = Util.getMappedSchema(configuration, sequence.schema);

        if (mappedSchema != null && configuration.getDialect() != CUBRID) {
            local.sql(mappedSchema);
            local.sql(".");
        }
View Full Code Here

        return (Sequence<? extends Number>) cSequences().getField("S_AUTHOR_ID").get(cSequences());
    }

    @SuppressWarnings("deprecation")
    protected final Schema schema() {
        Schema schema = TAuthor().getSchema();
        Schema mapped = create().getSchemaMapping().map(schema);

        return mapped != null ? mapped : schema;
    }
View Full Code Here

TOP

Related Classes of org.jooq.Schema

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.