Package com.asakusafw.modelgen.model

Examples of com.asakusafw.modelgen.model.StringType


                case BIG_DECIMAL:
                    DecimalType decimalType = new DecimalType(numericPrecision, numericScale);
                    builder.add(columnComment, columnName, decimalType, attributes);
                    break;
                case STRING:
                    StringType stringType = new StringType((int) characterMaximumLength);
                    builder.add(columnComment, columnName, stringType, attributes);
                    break;
                default:
                    builder.add(columnComment, columnName, propertyType, attributes);
                    break;
View Full Code Here


     */
    @Test
    public void simple() throws Throwable {
        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();
        JoinedModelDescription j = new JoinedModelBuilder("J", a, "a", b, "b")
            .on("a.id", "b.id")
            .add("id", "a.id")
            .add("hoge", "a.hoge")
View Full Code Here

    public void complex() throws Throwable {
        init("complex");

        TableModelDescription model = new TableModelBuilder("Model")
            .add(null, "id", PropertyTypeKind.LONG, Attribute.PRIMARY_KEY)
            .add(null, "value", new StringType(255))
            .add(null, "date", PropertyTypeKind.DATE)
            .add(null, "price", PropertyTypeKind.INT)
            .add(null, "flag", PropertyTypeKind.BOOLEAN)
            .toDescription();
View Full Code Here

     */
    @Test
    public void simple() throws Throwable {
        TableModelDescription model = new TableModelBuilder("Hello")
            .add(null, "id", PropertyTypeKind.LONG, Attribute.PRIMARY_KEY)
            .add(null, "value", new StringType(255))
            .toDescription();

        new Table().emit(model);

        ClassLoader loader = compile();
View Full Code Here

     */
    @Test
    public void writable() throws Throwable {
        TableModelDescription model = new TableModelBuilder("Hello")
            .add(null, "id", PropertyTypeKind.LONG, Attribute.PRIMARY_KEY)
            .add(null, "value", new StringType(255))
            .add(null, "nothing", new StringType(255))
            .toDescription();

        new Table().emit(model);

        ClassLoader loader = compile();
View Full Code Here

    @Test
    public void namespace() throws Throwable {
        TableModelDescription model = new TableModelBuilder("Hello")
            .namespace("testing", "table")
            .add(null, "id", PropertyTypeKind.LONG, Attribute.PRIMARY_KEY)
            .add(null, "value", new StringType(255))
            .toDescription();

        new Table().emit(model);

        ClassLoader loader = compile();
View Full Code Here

     */
    @Test
    public void complex() throws Throwable {
        TableModelDescription model = new TableModelBuilder("Model")
            .add(null, "id", PropertyTypeKind.LONG, Attribute.PRIMARY_KEY)
            .add(null, "value", new StringType(255))
            .add(null, "date", PropertyTypeKind.DATE)
            .add(null, "price", PropertyTypeKind.INT)
            .add(null, "flag", PropertyTypeKind.BOOLEAN)
            .toDescription();

View Full Code Here

     */
    @Test
    public void simple() throws Throwable {
        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")
View Full Code Here

     */
    @Test
    public void bad_name() throws Throwable {
        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")
View Full Code Here

     */
    @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

TOP

Related Classes of com.asakusafw.modelgen.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.