Package org.jooq

Examples of org.jooq.RenderContext.sql()


                // H2 renders arrays as rows
                if (family == H2) {
                    render.sql("(");

                    for (Object o : ((Object[]) val)) {
                        render.sql(separator);
                        new DefaultBinding<Object, Object>(new IdentityConverter(type.getComponentType()), isLob).sql(new DefaultBindingSQLContext<Object>(ctx.configuration(), ctx.render(), o));
                        separator = ", ";
                    }

                    render.sql(")");
View Full Code Here


                        render.sql(separator);
                        new DefaultBinding<Object, Object>(new IdentityConverter(type.getComponentType()), isLob).sql(new DefaultBindingSQLContext<Object>(ctx.configuration(), ctx.render(), o));
                        separator = ", ";
                    }

                    render.sql(")");
                }

                // By default, render HSQLDB / POSTGRES syntax
                else {
                    render.keyword("ARRAY");
View Full Code Here

                }

                // By default, render HSQLDB / POSTGRES syntax
                else {
                    render.keyword("ARRAY");
                    render.sql("[");

                    for (Object o : ((Object[]) val)) {
                        render.sql(separator);
                        new DefaultBinding<Object, Object>(new IdentityConverter(type.getComponentType()), isLob).sql(new DefaultBindingSQLContext<Object>(ctx.configuration(), ctx.render(), o));
                        separator = ", ";
View Full Code Here

                else {
                    render.keyword("ARRAY");
                    render.sql("[");

                    for (Object o : ((Object[]) val)) {
                        render.sql(separator);
                        new DefaultBinding<Object, Object>(new IdentityConverter(type.getComponentType()), isLob).sql(new DefaultBindingSQLContext<Object>(ctx.configuration(), ctx.render(), o));
                        separator = ", ";
                    }

                    render.sql("]");
View Full Code Here

                        render.sql(separator);
                        new DefaultBinding<Object, Object>(new IdentityConverter(type.getComponentType()), isLob).sql(new DefaultBindingSQLContext<Object>(ctx.configuration(), ctx.render(), o));
                        separator = ", ";
                    }

                    render.sql("]");

                    // [#3214] Some PostgreSQL array type literals need explicit casting
                    if (family == POSTGRES && EnumType.class.isAssignableFrom(type.getComponentType())) {
                        render.sql("::")
                               .keyword(DefaultDataType.getDataType(family, type).getCastTypeName(render.configuration()));
View Full Code Here

                    render.sql("]");

                    // [#3214] Some PostgreSQL array type literals need explicit casting
                    if (family == POSTGRES && EnumType.class.isAssignableFrom(type.getComponentType())) {
                        render.sql("::")
                               .keyword(DefaultDataType.getDataType(family, type).getCastTypeName(render.configuration()));
                    }
                }
            }
            /* [pro] xx
View Full Code Here

                else {
                    new DefaultBinding<Object, Object>(new IdentityConverter(String.class), isLob).sql(new DefaultBindingSQLContext<Object>(ctx.configuration(), ctx.render(), literal));
                }
            }
            else if (UDTRecord.class.isAssignableFrom(type)) {
                render.sql("[UDT]");
            }

            // Known fall-through types:
            // - Blob, Clob (both not supported by jOOQ)
            // - String
View Full Code Here

            // Known fall-through types:
            // - Blob, Clob (both not supported by jOOQ)
            // - String
            // - UUID
            else {
                render.sql("'")
                       .sql(escape(val, render), true)
                       .sql("'");
            }
        }
View Full Code Here

        // In Postgres, some additional casting must be done in some cases...
        else if (family == SQLDialect.POSTGRES) {

            // Postgres needs explicit casting for array types
            if (type.isArray() && byte[].class != type) {
                render.sql(getBindVariable(render));
                render.sql("::");
                render.keyword(DefaultDataType.getDataType(family, type).getCastTypeName(render.configuration()));
            }

            // ... and also for enum types
View Full Code Here

        else if (family == SQLDialect.POSTGRES) {

            // Postgres needs explicit casting for array types
            if (type.isArray() && byte[].class != type) {
                render.sql(getBindVariable(render));
                render.sql("::");
                render.keyword(DefaultDataType.getDataType(family, type).getCastTypeName(render.configuration()));
            }

            // ... and also for enum types
            else if (EnumType.class.isAssignableFrom(type)) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.