Package com.asakusafw.dmdl.thundergate.view.model

Examples of com.asakusafw.dmdl.thundergate.view.model.CreateView


                "from `test`.`t1`" +
                "join `test`.`t2`" +
                "where" +
                "  (`test`.`t1`.`pk` = `test`.`t2`.`pk`)");

        CreateView model = ViewParser.parse(def);
        assertThat(model, is(new CreateView(
                n("test"),
                Arrays.asList(new Select[] {
                        new Select(n("t1.pk"), Aggregator.IDENT, n("pk")),
                        new Select(n("t1.val1"), Aggregator.IDENT, n("val1")),
                        new Select(n("t2.val2"), Aggregator.IDENT, n("val2")),
View Full Code Here


                "from `test`.`t1` `a`" +
                "join `test`.`t2` `b`" +
                "where" +
                "  (`test`.`a`.`pk` = `test`.`b`.`pk`)");

        CreateView model = ViewParser.parse(def);
        assertThat(model, is(new CreateView(
                n("test"),
                Arrays.asList(new Select[] {
                        new Select(n("a.pk"), Aggregator.IDENT, n("pk")),
                        new Select(n("a.val1"), Aggregator.IDENT, n("val1")),
                        new Select(n("b.val2"), Aggregator.IDENT, n("val2")),
View Full Code Here

                "from" +
                "  `test`.`t1`" +
                "group by" +
                "  `test`.`t1`.`pk`");

        CreateView model = ViewParser.parse(def);
        assertThat(model, is(new CreateView(
                n("test"),
                Arrays.asList(new Select[] {
                        new Select(n("t1.pk"), Aggregator.IDENT, n("pk")),
                        new Select(n("t1.pk"), Aggregator.COUNT, n("count")),
                        new Select(n("t1.pk"), Aggregator.MAX, n("max")),
View Full Code Here

                "from" +
                "  `test`.`x` `t1`" +
                "group by" +
                "  `test`.`t1`.`pk`");

        CreateView model = ViewParser.parse(def);
        assertThat(model, is(new CreateView(
                n("test"),
                Arrays.asList(new Select[] {
                        new Select(n("t1.pk"), Aggregator.IDENT, n("pk")),
                        new Select(n("t1.pk"), Aggregator.COUNT, n("count")),
                        new Select(n("t1.pk"), Aggregator.MAX, n("max")),
View Full Code Here

                "from" +
                "  `test`.`t1`" +
                "group by" +
                "  `test`.`t1`.`val1` , `test`.`t1`.`val2`");

        CreateView model = ViewParser.parse(def);
        assertThat(model, is(new CreateView(
                n("test"),
                Arrays.asList(new Select[] {
                        new Select(n("t1.pk"), Aggregator.IDENT, n("pk")),
                        new Select(n("t1.pk"), Aggregator.COUNT, n("count")),
                        new Select(n("t1.pk"), Aggregator.MAX, n("max")),
View Full Code Here

        List<Name> sorted = Graphs.sortPostOrder(dependencies);

        List<CreateView> results = Lists.create();
        for (Name name : sorted) {
            // 外部参照でないものについてのみ結果に残す
            CreateView view = map.get(name);
            if (view != null) {
                results.add(view);
            }
        }
        return results;
View Full Code Here

        LOG.info("{}個のビュー定義を読み込みました", definitions.size());

        ViewAnalyzer analyzer = new ViewAnalyzer();
        for (ViewDefinition definition : definitions) {
            LOG.info("ビュー\"{}\"を解析しています", definition.name);
            CreateView tree = ViewParser.parse(definition);
            analyzer.add(tree);
        }

        List<ModelDescription> results = analyzer.analyze(repository);
        return results;
View Full Code Here

            throw new IllegalArgumentException("reader must not be null"); //$NON-NLS-1$
        }
        StringReader stream = new StringReader(definition.statement);
        JjViewParser parser = new JjViewParser(stream);
        try {
            CreateView parsed = parser.parse(definition.name);
            return parsed;
        } catch (ParseException e) {
            throw new IOException(MessageFormat.format(
                    "ビュー{0}の解析に失敗しました ({1})",
                    definition.name,
View Full Code Here

TOP

Related Classes of com.asakusafw.dmdl.thundergate.view.model.CreateView

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.