Package com.asakusafw.modelgen.util

Examples of com.asakusafw.modelgen.util.JoinedModelBuilder


        assert context != null;
        CreateView ast = target.ast;
        assert context.get(ast.from.table) != null;
        assert context.get(ast.from.join.table) != null;

        JoinedModelBuilder builder = new JoinedModelBuilder(
                ast.name.token,
                context.get(ast.from.table),
                ast.from.alias,
                context.get(ast.from.join.table),
                ast.from.join.alias);
        builder.namespace(target.namespace);

        // 結合条件
        for (On on : ast.from.join.condition) {
            builder.on(on.left.token, on.right.token);
        }

        // カラムの追加
        for (Select select : ast.selectList) {
            assert select.aggregator == Aggregator.IDENT;
            builder.add(select.alias.token, select.name.token);
        }

        return builder.toDescription();
    }
View Full Code Here


            .toDescription();
        TableModelDescription b = new TableModelBuilder("B")
            .add(null, "id", PropertyTypeKind.LONG)
            .add(null, "foo", new StringType(255))
            .toDescription();
        JoinedModelDescription j = new JoinedModelBuilder("J", a, "a", b, "b")
            .on("a.id", "b.id")
            .add("id", "a.id")
            .add("hoge", "a.hoge")
            .add("bar", "b.foo")
            .toDescription();
View Full Code Here

TOP

Related Classes of com.asakusafw.modelgen.util.JoinedModelBuilder

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.