Package org.jooq

Examples of org.jooq.RenderContext.render()


        r_refI.configuration().settings().setRenderNameStyle(RenderNameStyle.LOWER);
        assertEquals("select 1 as aa `bb` cc from table1 as xx ''yy''\\ zz", r_refI.render(q));

        r_refI.configuration().settings().setRenderNameStyle(RenderNameStyle.UPPER);
        assertEquals("select 1 as AA `BB` CC from TABLE1 as XX ''YY''\\ ZZ", r_refI.render(q));

        r_refI.configuration().settings().setRenderNameStyle(RenderNameStyle.QUOTED);
        assertEquals("select 1 as `Aa ``Bb`` Cc` from `TABLE1` as `Xx ''Yy''\\ Zz`", r_refI.render(q));
    }
View Full Code Here


        r_refI.configuration().settings().setRenderNameStyle(RenderNameStyle.UPPER);
        assertEquals("select 1 as AA `BB` CC from TABLE1 as XX ''YY''\\ ZZ", r_refI.render(q));

        r_refI.configuration().settings().setRenderNameStyle(RenderNameStyle.QUOTED);
        assertEquals("select 1 as `Aa ``Bb`` Cc` from `TABLE1` as `Xx ''Yy''\\ Zz`", r_refI.render(q));
    }

    @Test
    public void testRenderKeywordStyle() {
        Query q = create.select(val(1)).from(TABLE1).where(FIELD_ID1.equal(2));
View Full Code Here

        r_refP.configuration().settings().setRenderKeywordStyle(RenderKeywordStyle.UPPER);
        r_ref.configuration().settings().setRenderKeywordStyle(RenderKeywordStyle.UPPER);

        assertEquals("SELECT 1 FROM `TABLE1` WHERE `TABLE1`.`ID1` = 2", r_refI.render(q));
        assertEquals("SELECT :1 FROM `TABLE1` WHERE `TABLE1`.`ID1` = :2", r_refP.render(q));
        assertEquals("SELECT ? FROM `TABLE1` WHERE `TABLE1`.`ID1` = ?", r_ref.render(q));

        r_refI.configuration().settings().setRenderKeywordStyle(RenderKeywordStyle.LOWER);
        r_refP.configuration().settings().setRenderKeywordStyle(RenderKeywordStyle.LOWER);
        r_ref.configuration().settings().setRenderKeywordStyle(RenderKeywordStyle.LOWER);
View Full Code Here

        r_refP.configuration().settings().setRenderKeywordStyle(RenderKeywordStyle.LOWER);
        r_ref.configuration().settings().setRenderKeywordStyle(RenderKeywordStyle.LOWER);

        assertEquals("select 1 from `TABLE1` where `TABLE1`.`ID1` = 2", r_refI.render(q));
        assertEquals("select :1 from `TABLE1` where `TABLE1`.`ID1` = :2", r_refP.render(q));
        assertEquals("select ? from `TABLE1` where `TABLE1`.`ID1` = ?", r_ref.render(q));
    }
}
View Full Code Here

    public void testData() {
        RenderContext ctx = create.renderContext();
        ctx.data("key", "value");

        TestDataQueryPart part = new TestDataQueryPart();
        ctx.render(part);
        assertEquals("value", part.value);
    }

    private static class TestDataQueryPart extends CustomCondition {
View Full Code Here

                }

                i++;
            }

            Field<T> result = function(local.render(), getDataType(), array);

            // [#3592] Decrease SQL -> PL/SQL context switches with Oracle Scalar Subquery Caching
            if (TRUE.equals(settings(ctx.configuration()).isRenderScalarSubqueriesForStoredFunctions())) {
                result = DSL.select(result).asField();
            }
View Full Code Here

            local.sql(mappedSchema);
            local.sql(".");
        }

        local.literal(sequence.name);
        return local.render();
    }
}
View Full Code Here

     * {@link SQLDialect#SQLSERVER} and {@link SQLDialect#SYBASE} dialects
     */
    private final void toSQLReferenceLimitDB2SQLServerSybase(RenderContext context) {
        RenderContext local = new DefaultRenderContext(context);
        toSQLReference0(local);
        String enclosed = local.render();

        String subqueryName = "limit_" + Util.hash(enclosed);
        String rownumName = "rownum_" + Util.hash(enclosed);

        context.keyword("select * from (")
View Full Code Here

     * dialect
     */
    private final void toSQLReferenceLimitOracle(RenderContext context) {
        RenderContext local = new DefaultRenderContext(context);
        toSQLReference0(local);
        String enclosed = local.render();

        String subqueryName = "limit_" + Util.hash(enclosed);
        String rownumName = "rownum_" + Util.hash(enclosed);

        context.keyword("select * from (")
View Full Code Here

        RenderContext r_refP = r_refP();
        RenderContext r_ref = r_ref();

        assertEquals("'abc''def'", r_refI.render(i1));
        assertEquals("'abc''def'", r_refP.render(i1));
        assertEquals("'abc''def'", r_ref.render(i1));

        assertEquals("123", r_refI.render(i2));
        assertEquals("123", r_refP.render(i2));
        assertEquals("123", r_ref.render(i2));
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.