Package net.paoding.rose.jade.statement.expression

Examples of net.paoding.rose.jade.statement.expression.ExqlPattern.execute()


        // 转换语句中的表达式
        ExqlPattern pattern = ExqlPatternImpl.compile(runtime.getSQL());
        ExqlContextImpl context = new ExqlContextImpl(runtime.getSQL().length() + 32);

        try {
            pattern.execute(context, runtime.getParameters(), runtime.getMetaData()
                    .getDAOMetaData().getConstants());
            runtime.setArgs(context.getParams());
            runtime.setSQL(context.flushOut());
        } catch (Exception e) {
            String daoInfo = runtime.getMetaData().toString();
View Full Code Here


        Map<String, Object> parametersAsMap = new HashMap<String, Object>();
        parametersAsMap.put(":1", "p1");
        parametersAsMap.put(":2", "p2");

        String result = pattern.execute(context, parametersAsMap);
        System.out.println(result);
    }

}
View Full Code Here

        map.put("expr4", expr4);
        map.put("expr5", expr5);

        Assert.assertEquals("SELECT ?, ?, expr3 WHERE e = ? AND c = ? AND c = ? "
                + "AND c = ? AND c = ? AND c = ? GROUP BY expr1 ASC", // NL
                pattern.execute(context, map));

        Object[] expectArray = new Object[] { expr1.length(), expr2.getClass().getName(), expr4,
                expr5.getBytes()[0], expr5.getBytes()[1], expr5.getBytes()[2], expr5.getBytes()[3],
                expr5.getBytes()[4] };
        Object[] paramArray = context.getParams();
View Full Code Here

        map.put("expr4", expr4);
        map.put("expr5", expr5);

        Assert.assertEquals("SELECT ?, ?, expr3 WHERE e = ? AND c = ? AND c = ? "
                + "AND c = ? AND c = ? AND c = ? GROUP BY expr1 ASC", // NL
                pattern.execute(context, map, map));

        Object[] expectArray = new Object[] { expr1.length(), expr2.getClass().getName(), expr4,
                expr5.getBytes()[0], expr5.getBytes()[1], expr5.getBytes()[2], expr5.getBytes()[3],
                expr5.getBytes()[4] };
        Object[] paramArray = context.getParams();
View Full Code Here

        map.put("expr4", expr4);
        map.put("expr5", expr5);

        Assert.assertEquals("SELECT ?, ?, expr3 WHERE e = ? AND c = ? AND c = ? "
                + "AND c = ? AND c = ? AND c = ? GROUP BY expr1 ASC", // NL
                pattern.execute(context, map, map));

        Object[] expectArray = new Object[] { expr1.length(), expr2.getBytes()[expr1.length() - 1],
                expr4, expr5.getBytes()[0], expr5.getBytes()[1], expr5.getBytes()[2],
                expr5.getBytes()[3], expr5.getBytes()[4] };
        Object[] paramArray = context.getParams();
View Full Code Here

        map.put("expr4", "expr4");
        map.put("expr5", "expr5");
        // map.put("expr6", "expr6");
        map.put("expr7", "expr7");

        System.out.println(pattern.execute(context, map, map));
        System.out.println(Arrays.toString(context.getParams()));
    }
}
View Full Code Here

        map.put("expr2", "expr2");
        map.put("expr3", "expr3");
        map.put("expr4", "expr4");
        map.put("expr5", "expr5");

        System.out.println(pattern.execute(context, map));
        System.out.println(Arrays.toString(context.getParams()));
    }
}
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.