Examples of parseOnly()


Examples of com.redspr.redquerybuilder.core.client.command.Parser.parseOnly()

    }

    @Test
    public void testSimpleSelect() throws Exception {
        Parser p = new Parser(getSession());
        Prepared prep = p.parseOnly("SELECT id FROM Person WHERE sex = ?");

        Select s = (Select) prep;
        assertTrue(s != null);
        ExpressionColumn ec = (ExpressionColumn) s.getExpressions().get(0);
        assertEquals("ID", ec.getSQL(new ArrayList()));
View Full Code Here

Examples of com.redspr.redquerybuilder.core.client.command.Parser.parseOnly()

    }

    @Test
    public void testParseLike() throws Exception {
        Parser p = new Parser(getSession());
        Prepared prep = p.parseOnly("SELECT id FROM Person WHERE owner LIKE ?");

        Select s = (Select) prep;

        assertEquals("SELECT ID\nFROM PERSON\nWHERE (OWNER LIKE ?)", s.getSQL(new ArrayList()));
    }
View Full Code Here

Examples of com.redspr.redquerybuilder.core.client.command.Parser.parseOnly()

    }

    @Test
    public void testParseCustom() throws Exception {
        Parser p = new Parser(getSession());
        Prepared prep = p.parseOnly("SELECT id FROM Person WHERE sex CUSTOM_OP ?");

        Select s = (Select) prep;

        assertEquals("SELECT ID\nFROM PERSON\nWHERE (SEX CUSTOM_OP ?)", s.getSQL(new ArrayList()));
    }
View Full Code Here

Examples of com.redspr.redquerybuilder.core.client.command.Parser.parseOnly()

    @Test
    public void testIsNull() throws Exception {
        Session sess = getSession();
        Parser p = new Parser(sess);

        Prepared prep = p.parseOnly("SELECT id FROM Person x1 WHERE x1.sex IS NULL");

        Select s = (Select) prep;
        Comparison c = (Comparison) s.getCondition();

        // test output
View Full Code Here

Examples of com.redspr.redquerybuilder.core.client.command.Parser.parseOnly()

    public void testParseAlias() throws Exception {
        Session sess = getSession();
        Parser p = new Parser(sess);

        sess.getValueRegistry().add("foo");
        Prepared prep = p.parseOnly("SELECT id FROM Person x1 WHERE x1.sex = ?");

        Select s = (Select) prep;
        assertTrue(s != null);
        ExpressionColumn ec = (ExpressionColumn) s.getExpressions().get(0);
View Full Code Here

Examples of com.redspr.redquerybuilder.core.client.command.Parser.parseOnly()

    public void testParseAliasWithBrackets() throws Exception {
        Session sess = getSession();
        Parser p = new Parser(sess);

        sess.getValueRegistry().add("foo");
        Prepared prep = p.parseOnly("SELECT id FROM Person x1 WHERE (x1.sex = ?)");

        Select s = (Select) prep;
        assertTrue(s != null);
        ExpressionColumn ec = (ExpressionColumn) s.getExpressions().get(0);
View Full Code Here

Examples of com.redspr.redquerybuilder.core.client.command.Parser.parseOnly()

    public void testParseJoin() throws Exception {
        Session sess = getSession();
        Parser p = new Parser(sess);

        sess.getValueRegistry().add("foo");
        Prepared prep = p.parseOnly("SELECT x1.id FROM \"Log\" x1 JOIN \"PERSON\" x0 ON x1.\"parent\" = x0.\"id\" WHERE (x0.\"owner\" = ?)");

        Select s = (Select) prep;

        assertEquals(2, s.getFilters().size());
View Full Code Here

Examples of com.redspr.redquerybuilder.core.client.command.Parser.parseOnly()

            + " LEFT JOIN Log x2 ON x2.parent=x0.id"
            + " LEFT JOIN Log x4 ON x4.parent=x0.id"
            + " LEFT JOIN Person x3 ON x2.parent=x3.id"
            + " WHERE x1.id=?";

        Prepared prep = p.parseOnly(sql0);

        Select s = (Select) prep;

        s.garbageCollectFilters();
View Full Code Here

Examples of com.redspr.redquerybuilder.core.client.command.Parser.parseOnly()

    public void testParseAndGenerateEmptyIn() throws Exception {
        Parser p = new Parser(getSession());
        String sql0 = "SELECT x.id FROM Person x"
            + " WHERE x.category IN (NULL)";

        Prepared prep = p.parseOnly(sql0);

        Select s = (Select) prep;

        // collect initial non-sense...
        String sql1 = "SELECT X.ID\nFROM PERSON X\n"
View Full Code Here

Examples of org.apache.pig.tools.grunt.GruntParser.parseOnly()

        try {
            GruntParser grunt = new GruntParser(new StringReader(substituted), this);
            grunt.setInteractive(false);
            setBatchOn();
            //grunt.setLoadOnly(true);
            grunt.parseOnly();
        } catch (org.apache.pig.tools.pigscript.parser.ParseException e) {
            log.error(e.getLocalizedMessage());
            throw new IOException(e);
        }
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.