Package com.asakusafw.dmdl.thundergate.model

Examples of com.asakusafw.dmdl.thundergate.model.ModelProperty


        assertThat(desc.getReference().getSimpleName(), is("Example"));

        List<ModelProperty> properties = desc.getProperties();
        assertThat(properties.size(), is(1));

        ModelProperty value = properties.get(0);
        assertThat(value.getName(), is("value"));
        assertThat(value.getType().getKind(), is(PropertyTypeKind.INT));
        assertThat(value.getJoined(), is(nullValue()));

        Source valueSrc = value.getFrom();
        assertThat(valueSrc.getAggregator(), is(Aggregator.IDENT));
        assertThat(valueSrc.getDeclaring(), is(desc.getReference()));
        assertThat(valueSrc.getName(), is("value"));
        assertThat(valueSrc.getType().getKind(), is(PropertyTypeKind.INT));
        assertThat(valueSrc.getAttributes().size(), is(0));
View Full Code Here


        assertThat(desc.getReference().getSimpleName(), is("Example"));

        List<ModelProperty> properties = desc.getProperties();
        assertThat(properties.size(), is(3));

        ModelProperty a = properties.get(0);
        assertThat(a.getName(), is("a"));
        assertThat(a.getType().getKind(), is(PropertyTypeKind.INT));

        ModelProperty b = properties.get(1);
        assertThat(b.getName(), is("b"));
        assertThat(b.getType().getKind(), is(PropertyTypeKind.STRING));

        ModelProperty c = properties.get(2);
        assertThat(c.getName(), is("c"));
        assertThat(c.getType().getKind(), is(PropertyTypeKind.DATETIME));
    }
View Full Code Here

        assertThat(desc.getReference().getSimpleName(), is("Attribute"));

        List<ModelProperty> properties = desc.getProperties();
        assertThat(properties.size(), is(2));

        ModelProperty a = properties.get(0);
        assertThat(a.getName(), is("id"));
        assertThat(a.getType().getKind(), is(PropertyTypeKind.LONG));
        Set<Attribute> aAttr = a.getFrom().getAttributes();
        assertThat(aAttr.size(), is(1));
        assertThat(aAttr.contains(Attribute.PRIMARY_KEY), is(true));

        ModelProperty b = properties.get(1);
        assertThat(b.getName(), is("str"));
        assertThat(b.getType().getKind(), is(PropertyTypeKind.STRING));
        Set<Attribute> bAttr = b.getFrom().getAttributes();
        assertThat(bAttr.size(), is(2));
        assertThat(bAttr.containsAll(list(Attribute.UNIQUE, Attribute.NOT_NULL)), is(true));
    }
View Full Code Here

        assertThat(desc.getJoinCondition(), is(sources(b, "id")));

        List<ModelProperty> props = desc.getProperties();
        assertThat(props.size(), is(3));

        ModelProperty id = props.get(0);
        assertThat(id.getName(), is("id"));
        assertThat(id.getType().getKind(), is(PropertyTypeKind.LONG));
        assertThat(id.getFrom(), is(source(a, "id")));
        assertThat(id.getJoined(), is(source(b, "id")));


        ModelProperty hoge = props.get(1);
        assertThat(hoge.getName(), is("hoge"));
        assertThat(hoge.getType().getKind(), is(PropertyTypeKind.STRING));
        assertThat(hoge.getFrom(), is(source(a, "hoge")));
        assertThat(hoge.getJoined(), is(nullValue()));


        ModelProperty bar = props.get(2);
        assertThat(bar.getName(), is("bar"));
        assertThat(bar.getType().getKind(), is(PropertyTypeKind.STRING));
        assertThat(bar.getFrom(), is(nullValue()));
        assertThat(bar.getJoined(), is(source(b, "foo")));
    }
View Full Code Here

        assertThat(model.getGroupBy(), is(sources(desc, "word")));

        List<ModelProperty> properties = model.getProperties();
        assertThat(properties.size(), is(2));

        ModelProperty word = properties.get(0);
        assertThat(word.getName(), is("word"));
        assertThat(word.getType().getKind(), is(PropertyTypeKind.STRING));
        assertThat(word.getJoined(), is(nullValue()));
        assertThat(
                word.getFrom(),
                is(source(desc, "word", Aggregator.IDENT)));

        ModelProperty count = properties.get(1);
        assertThat(count.getName(), is("count"));
        assertThat(count.getType().getKind(), is(PropertyTypeKind.LONG));
        assertThat(count.getJoined(), is(nullValue()));
        assertThat(
                count.getFrom(),
                is(source(desc, "word", Aggregator.COUNT)));
    }
View Full Code Here

        assertThat(model.getGroupBy(), is(sources(desc)));

        List<ModelProperty> properties = model.getProperties();
        assertThat(properties.size(), is(1));

        ModelProperty count = properties.get(0);
        assertThat(count.getName(), is("count"));
        assertThat(count.getType().getKind(), is(PropertyTypeKind.LONG));
        assertThat(
                count.getFrom(),
                is(source(desc, "word", Aggregator.COUNT)));
    }
View Full Code Here

        assertThat(model.getGroupBy(), is(sources(desc, "sex", "age")));

        List<ModelProperty> properties = model.getProperties();
        assertThat(properties.size(), is(3));

        ModelProperty sex = properties.get(0);
        assertThat(sex.getName(), is("sex"));
        assertThat(sex.getType().getKind(), is(PropertyTypeKind.BYTE));
        assertThat(
                sex.getFrom(),
                is(source(desc, "sex", Aggregator.IDENT)));

        ModelProperty age = properties.get(1);
        assertThat(age.getName(), is("age"));
        assertThat(age.getType().getKind(), is(PropertyTypeKind.SHORT));
        assertThat(
                age.getFrom(),
                is(source(desc, "age", Aggregator.IDENT)));

        ModelProperty count = properties.get(2);
        assertThat(count.getName(), is("count"));
        assertThat(count.getType().getKind(), is(PropertyTypeKind.LONG));
        assertThat(
                count.getFrom(),
                is(source(desc, "name", Aggregator.COUNT)));
    }
View Full Code Here

                    AstBuilder.toName(property)));
        }

        List<AstSimpleName> grouping = Lists.create();
        for (Source source : group) {
            ModelProperty property = resolver.get(source.getName());
            assert property != null : source;
            grouping.add(AstBuilder.toName(property));
        }

        return new AstJoin(
View Full Code Here

        List<ModelProperty> properties = Lists.create();
        for (String mapTo : columns) {
            SourcePair sources = pairs.get(mapTo);
            assert sources != null;
            assert sources.left != null || sources.right != null;
            ModelProperty property = new ModelProperty(
                    mapTo,
                    sources.left,
                    sources.right);
            properties.add(property);
        }
View Full Code Here

                        "プロパティ \"{0}.{1}\" は集約関数かグループ化のキーとして指定する必要があります ({2})",
                        source.getDeclaring(),
                        source.getName(),
                        getReference()));
            }
            ModelProperty property = toProperty(column);
            properties.add(property);
        }
        validate();
        return new SummarizedModelDescription(
                getReference(),
View Full Code Here

TOP

Related Classes of com.asakusafw.dmdl.thundergate.model.ModelProperty

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.