Search in sources :

Example 31 with ColumnType

use of com.linkedpipes.plugin.transformer.tabularuv.TabularConfig_V2.ColumnType in project molgenis-emx2 by molgenis.

the class TestMapPojoToTable method testTypeTestToTable.

@Test
public void testTypeTestToTable() {
    TableMetadata table = Mapper.map(TypeTestBean.class);
    for (ColumnType columnType : new ColumnType[] { STRING, INT, DECIMAL, BOOL, DATE, DATETIME }) {
        String columnName = "a" + columnType.toString().substring(0, 1).toUpperCase() + columnType.toString().substring(1).toLowerCase();
        assertEquals(columnType, table.getColumn(columnName).getColumnType());
    }
}
Also used : ColumnType(org.molgenis.emx2.ColumnType) Test(org.junit.Test)

Example 32 with ColumnType

use of com.linkedpipes.plugin.transformer.tabularuv.TabularConfig_V2.ColumnType in project molgenis-emx2 by molgenis.

the class RefAndRefArrayTestExample method createRefAndRefArrayTestExample.

public static void createRefAndRefArrayTestExample(SchemaMetadata schema) {
    ColumnType[] columnTypes = new ColumnType[] { UUID, STRING, BOOL, INT, DECIMAL, TEXT, DATE, DATETIME };
    for (ColumnType columnType : columnTypes) {
        String aTableName = columnType.toString() + "_A";
        String fieldName = "AKeyOf" + columnType;
        schema.create(table(aTableName).add(column(fieldName).setType(columnType).setPkey()));
        String bTableName = columnType.toString() + "_B";
        String refFromBToA = "RefToAKeyOf" + columnType;
        String refArrayFromBToA = "RefArrayToAKeyOf" + columnType;
        schema.create(table(bTableName).add(column(refFromBToA).setType(REF).setRefTable(aTableName)).add(column(refArrayFromBToA).setType(REF_ARRAY).setRefTable(aTableName)));
    }
}
Also used : ColumnType(org.molgenis.emx2.ColumnType)

Example 33 with ColumnType

use of com.linkedpipes.plugin.transformer.tabularuv.TabularConfig_V2.ColumnType in project molgenis-emx2 by molgenis.

the class SimpleTypeTestExample method createSimpleTypeTest.

public static void createSimpleTypeTest(SchemaMetadata schema) {
    TableMetadata typeTestTable = table(TYPE_TEST).add(column("id").setPkey());
    ColumnType[] columnTypes = new ColumnType[] { UUID, STRING, BOOL, INT, LONG, DECIMAL, TEXT, DATE, DATETIME };
    for (ColumnType columnType : columnTypes) {
        typeTestTable.add(column("Test " + columnType.toString().toLowerCase()).setType(columnType).setRequired(true));
        typeTestTable.add(column("Test " + columnType.toString().toLowerCase() + " nillable").setType(columnType));
    }
    schema.create(typeTestTable);
}
Also used : TableMetadata(org.molgenis.emx2.TableMetadata) ColumnType(org.molgenis.emx2.ColumnType)

Aggregations

ColumnType (org.molgenis.emx2.ColumnType)11 Function (com.google.common.base.Function)10 Before (org.junit.Before)10 TableMetadata (org.molgenis.emx2.TableMetadata)5 ColumnType (com.google.api.ads.admanager.axis.v202105.ColumnType)2 ColumnType (com.google.api.ads.admanager.axis.v202108.ColumnType)2 ColumnType (com.google.api.ads.admanager.axis.v202111.ColumnType)2 ColumnType (com.google.api.ads.admanager.axis.v202202.ColumnType)2 ColumnType (com.google.api.ads.admanager.axis.v202205.ColumnType)2 ColumnType (com.google.api.ads.admanager.jaxws.v202108.ColumnType)2 ColumnType (com.google.api.ads.admanager.jaxws.v202202.ColumnType)2 ColumnType (com.google.api.ads.admanager.jaxws.v202205.ColumnType)2 ArrayList (java.util.ArrayList)2 Test (org.junit.Test)2 AdUnitTargeting (com.google.api.ads.admanager.axis.v202105.AdUnitTargeting)1 BooleanValue (com.google.api.ads.admanager.axis.v202105.BooleanValue)1 Date (com.google.api.ads.admanager.axis.v202105.Date)1 DateTime (com.google.api.ads.admanager.axis.v202105.DateTime)1 DateTimeValue (com.google.api.ads.admanager.axis.v202105.DateTimeValue)1 DateValue (com.google.api.ads.admanager.axis.v202105.DateValue)1