Package com.asakusafw.modelgen.util

Examples of com.asakusafw.modelgen.util.SummarizedModelBuilder


        assert target.ast.getKind() == CreateView.Kind.SUMMARIZED;

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

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

        // グループ化
        for (Name name : ast.groupBy) {
            builder.groupBy(name.token);
        }

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

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


        TableModelDescription a = new TableModelBuilder("A")
            .add(null, "id", PropertyTypeKind.LONG, Attribute.PRIMARY_KEY)
            .add(null, "word", new StringType(255))
            .toDescription();

        SummarizedModelDescription model = new SummarizedModelBuilder("S", a, "a")
            .add("word", Aggregator.IDENT, "a.word")
            .add("count", Aggregator.COUNT, "a.word")
            .groupBy("a.word")
            .toDescription();
View Full Code Here

        TableModelDescription a = new TableModelBuilder("A")
            .add(null, "id", PropertyTypeKind.LONG, Attribute.PRIMARY_KEY)
            .add(null, "value", PropertyTypeKind.INT)
            .toDescription();

        SummarizedModelDescription model = new SummarizedModelBuilder("S", a, "a")
            .add("sumId", Aggregator.IDENT, "a.id")
            .add("sumSum", Aggregator.SUM, "a.value")
            .add("sumCount", Aggregator.COUNT, "a.value")
            .add("sumMax", Aggregator.MAX, "a.value")
            .add("sumMin", Aggregator.MIN, "a.value")
View Full Code Here

        TableModelDescription a = new TableModelBuilder("A__a")
            .add(null, "id__a", PropertyTypeKind.LONG, Attribute.PRIMARY_KEY)
            .add(null, "word__a", new StringType(255))
            .toDescription();

        SummarizedModelDescription model = new SummarizedModelBuilder("_S__a", a, "a")
            .add("_word__a", Aggregator.IDENT, "a.word__a")
            .add("_count__a", Aggregator.COUNT, "a.word__a")
            .groupBy("a.word__a")
            .toDescription();
View Full Code Here

TOP

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

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.