Package com.asakusafw.dmdl.thundergate.model

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


     */
    @Test
    public void multi() {
        TableModelBuilder target = new TableModelBuilder("Example");
        target.add(null, "a", PropertyTypeKind.INT);
        target.add(null, "b", new StringType(255));
        target.add(null, "c", PropertyTypeKind.DATETIME);
        TableModelDescription desc = target.toDescription();

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

View Full Code Here


     */
    @Test
    public void attributes() {
        TableModelBuilder target = new TableModelBuilder("Attribute");
        target.add(null, "id", PropertyTypeKind.LONG, Attribute.PRIMARY_KEY);
        target.add(null, "str", new StringType(255), Attribute.UNIQUE, Attribute.NOT_NULL);
        TableModelDescription desc = target.toDescription();

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

        List<ModelProperty> properties = desc.getProperties();
View Full Code Here

     */
    @Test
    public void simple() {
        TableModelDescription a = new TableModelBuilder("A")
            .add(null, "id", PropertyTypeKind.LONG)
            .add(null, "hoge", new StringType(255))
            .toDescription();
        TableModelDescription b = new TableModelBuilder("B")
            .add(null, "id", PropertyTypeKind.LONG)
            .add(null, "foo", new StringType(255))
            .toDescription();

        JoinedModelBuilder target = new JoinedModelBuilder(
                "J",
                a, "a",
View Full Code Here

     * @throws Exception if test was failed
     */
    @Test
    public void table() throws Exception {
        TableModelDescription table = new TableModelBuilder("SIMPLE")
            .add("comment", "VALUE", new StringType(255))
            .toDescription();

        ThunderGateModelEmitter emitter = new ThunderGateModelEmitter(config());
        emitter.emit(table);

View Full Code Here

    @Test
    public void join() throws Exception {
        TableModelDescription left = new TableModelBuilder("LEFT")
            .add(null, "SID", PropertyTypeKind.LONG, Attribute.PRIMARY_KEY)
            .add(null, "RIGHT_ID", PropertyTypeKind.LONG)
            .add(null, "VALUE", new StringType(255))
            .toDescription();
        TableModelDescription right = new TableModelBuilder("RIGHT")
            .add(null, "SID", PropertyTypeKind.LONG, Attribute.PRIMARY_KEY)
            .add(null, "VALUE", new StringType(255))
            .toDescription();
        JoinedModelDescription join = new JoinedModelBuilder("SIMPLE", left, "l", right, "r")
            .on("l.RIGHT_ID", "r.SID")
            .add("ID", "r.SID")
            .add("LEFT", "l.VALUE")
View Full Code Here

    @Test
    public void simple() {
        TableModelDescription left = new TableModelBuilder("LEFT")
            .add(null, "SID", PropertyTypeKind.LONG, Attribute.PRIMARY_KEY)
            .add(null, "RIGHT_ID", PropertyTypeKind.LONG)
            .add(null, "VALUE", new StringType(255))
            .toDescription();
        TableModelDescription right = new TableModelBuilder("RIGHT")
            .add(null, "SID", PropertyTypeKind.LONG, Attribute.PRIMARY_KEY)
            .add(null, "VALUE", new StringType(255))
            .toDescription();
        JoinedModelDescription join = new JoinedModelBuilder("SIMPLE", left, "l", right, "r")
            .on("l.RIGHT_ID", "r.SID")
            .add("ID", "r.SID")
            .add("LEFT", "l.VALUE")
View Full Code Here

     * 単純なワードカウント。
     */
    @Test
    public void simple() {
        TableModelDescription desc = new TableModelBuilder("A")
            .add(null, "word", new StringType(255))
            .toDescription();

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

     * 全てを単一のグループにまとめる。
     */
    @Test
    public void singleGroup() {
        TableModelDescription desc = new TableModelBuilder("A")
            .add(null, "word", new StringType(255))
            .toDescription();

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

    @Test
    public void multiGroupKey() {
        TableModelDescription desc = new TableModelBuilder("A")
            .add(null, "sex", PropertyTypeKind.BYTE)
            .add(null, "age", PropertyTypeKind.SHORT)
            .add(null, "name", new StringType(255))
            .toDescription();

        SummarizedModelDescription model = new SummarizedModelBuilder("S", desc, "a")
            .add("sex", Aggregator.IDENT, "sex")
            .add("age", Aggregator.IDENT, "age")
View Full Code Here

     * simple table.
     */
    @Test
    public void simple() {
        TableModelDescription table = new TableModelBuilder("SIMPLE")
            .add("comment", "VALUE", new StringType(255))
            .toDescription();
        emitDmdl(RecordModelGenerator.generate(table));

        ModelLoader loader = generateJava();
        loader.setNamespace(Constants.SOURCE_TABLE);
View Full Code Here

TOP

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

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.