Package org.jooq

Examples of org.jooq.Configuration


    // XXX Executing queries
    // -------------------------------------------------------------------------

    @Override
    public <R extends Record> Result<R> fetch(ResultQuery<R> query) {
        final Configuration previous = Utils.getConfiguration(query);

        try {
            query.attach(configuration());
            return query.fetch();
        }
View Full Code Here


        }
    }

    @Override
    public <R extends Record> Cursor<R> fetchLazy(ResultQuery<R> query) {
        final Configuration previous = Utils.getConfiguration(query);

        try {
            query.attach(configuration());
            return query.fetchLazy();
        }
View Full Code Here

        }
    }

    @Override
    public <R extends Record> List<Result<Record>> fetchMany(ResultQuery<R> query) {
        final Configuration previous = Utils.getConfiguration(query);

        try {
            query.attach(configuration());
            return query.fetchMany();
        }
View Full Code Here

        }
    }

    @Override
    public <R extends Record> R fetchOne(ResultQuery<R> query) {
        final Configuration previous = Utils.getConfiguration(query);

        try {
            query.attach(configuration());
            return query.fetchOne();
        }
View Full Code Here

        }
    }

    @Override
    public <T, R extends Record1<T>> T fetchValue(ResultQuery<R> query) {
        final Configuration previous = Utils.getConfiguration(query);

        try {
            query.attach(configuration());
            return value1(fetchOne(query));
        }
View Full Code Here

        return fetchExists(selectOne().from(table).where(condition));
    }

    @Override
    public int execute(Query query) {
        final Configuration previous = Utils.getConfiguration(query);

        try {
            query.attach(configuration());
            return query.execute();
        }
View Full Code Here

    private static final JooqLogger log   = JooqLogger.getLogger(LoggerListener.class);

    @Override
    public void renderEnd(ExecuteContext ctx) {
        if (log.isDebugEnabled()) {
            Configuration configuration = ctx.configuration();

            // [#2939] Prevent excessive logging of bind variables only in DEBUG mode, not in TRACE mode.
            if (!log.isTraceEnabled()) {
                configuration = abbreviateBindVariables(configuration);
            }
View Full Code Here

        return RecordImpl.class;
    }

    @Override
    protected final Field<?>[] getFields(ResultSetMetaData meta) {
        Configuration configuration = configuration();
        return new MetaDataFieldProvider(configuration, meta).getFields();
    }
View Full Code Here

        return sb.toString();
    }

    @Override
    public void register(BindingRegisterContext<U> ctx) throws SQLException {
        Configuration configuration = ctx.configuration();
        int sqlType = DefaultDataType.getDataType(ctx.dialect(), type).getSQLType();

        switch (configuration.dialect().family()) {
            /* [pro] xx

            xx xxx xxxx xxxx xxxxxxx xxxxx xxxxxx xxxxx xx xxxx
            xx xxxx xxx xxxx xxxx
            xxxx xxxxxxx x
View Full Code Here

        }
    }

    @Override
    public void set(BindingSetStatementContext<U> ctx) throws SQLException {
        Configuration configuration = ctx.configuration();
        SQLDialect dialect = ctx.dialect();
        T value = converter.to(ctx.value());

        if (log.isTraceEnabled()) {
            if (value != null && value.getClass().isArray() && value.getClass() != byte[].class) {
                log.trace("Binding variable " + ctx.index(), Arrays.asList((Object[]) value) + " (" + type + ")");
            }
            else {
                log.trace("Binding variable " + ctx.index(), value + " (" + type + ")");
            }
        }

        // Setting null onto a prepared statement is subtly different for every
        // SQL dialect. See the following section for details
        if (value == null) {
            int sqlType = DefaultDataType.getDataType(dialect, type).getSQLType();

            /* [pro] xx
            xx xxxxxxxxxxxx xxxxx xxxxx xxxx xx xx xxxxx xxxx xxxxx xxxx xxxx
            xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx x
                xxxxxx xxxxxxxx x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxx
                xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx xxxxxxxxxx
            x

            xxxx
            xx [/pro] */
            // [#1126] Oracle's UDTs need to be bound with their type name
            if (UDTRecord.class.isAssignableFrom(type)) {
                String typeName = Utils.newRecord(false, (Class<UDTRecord<?>>) type)
                                       .<RuntimeException>operate(null)
                                       .getUDT()
                                       .getName();
                ctx.statement().setNull(ctx.index(), sqlType, typeName);
            }

            // [#1225] [#1227] TODO Put this logic into DataType
            // Some dialects have trouble binding binary data as BLOB
            else if (asList(POSTGRES).contains(configuration.dialect()) && sqlType == Types.BLOB) {
                ctx.statement().setNull(ctx.index(), Types.BINARY);
            }

            /* [pro] xx
            xxxx xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xx xxxxxxx x
View Full Code Here

TOP

Related Classes of org.jooq.Configuration

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.