Search in sources :

Example 21 with Schema

use of org.jooq.Schema in project jOOQ by jOOQ.

the class TableImpl method accept0.

private void accept0(Context<?> ctx) {
    if (ctx.qualify() && (!asList(POSTGRES).contains(ctx.family()) || parameters == null || ctx.declareTables())) {
        Schema mappedSchema = Tools.getMappedSchema(ctx.configuration(), getSchema());
        if (mappedSchema != null) {
            ctx.visit(mappedSchema);
            ctx.sql('.');
        }
    }
    ctx.literal(Tools.getMappedTable(ctx.configuration(), this).getName());
    if (parameters != null && ctx.declareTables()) {
        // [#2925] Some dialects don't like empty parameter lists
        if (ctx.family() == FIREBIRD && parameters.length == 0)
            ctx.visit(new QueryPartList<Field<?>>(parameters));
        else
            ctx.sql('(').visit(new QueryPartList<Field<?>>(parameters)).sql(')');
    }
}
Also used : Field(org.jooq.Field) Schema(org.jooq.Schema)

Example 22 with Schema

use of org.jooq.Schema in project jOOQ by jOOQ.

the class Tools method getMappedUDTName.

/**
     * Map an {@link ArrayRecord} according to the configured {@link org.jooq.SchemaMapping}
     */
static final String getMappedUDTName(Configuration configuration, UDTRecord<?> record) {
    UDT<?> udt = record.getUDT();
    Schema mapped = getMappedSchema(configuration, udt.getSchema());
    StringBuilder sb = new StringBuilder();
    if (mapped != null)
        sb.append(mapped.getName()).append('.');
    sb.append(record.getUDT().getName());
    return sb.toString();
}
Also used : Schema(org.jooq.Schema)

Aggregations

Schema (org.jooq.Schema)22 TableField (org.jooq.TableField)6 Record (org.jooq.Record)5 TableRecord (org.jooq.TableRecord)4 UpdatableRecord (org.jooq.UpdatableRecord)4 DSL.currentSchema (org.jooq.impl.DSL.currentSchema)4 Table (org.jooq.Table)3 InformationSchema (org.jooq.util.xml.jaxb.InformationSchema)3 ArrayList (java.util.ArrayList)2 LinkedHashSet (java.util.LinkedHashSet)2 Name (org.jooq.Name)2 Sequence (org.jooq.Sequence)2 Support (org.jooq.Support)2 IOException (org.jooq.exception.IOException)2 SchemaDefinition (org.jooq.util.SchemaDefinition)2 Collections.unmodifiableList (java.util.Collections.unmodifiableList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 DocumentBuilder (javax.xml.parsers.DocumentBuilder)1 DocumentBuilderFactory (javax.xml.parsers.DocumentBuilderFactory)1