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());
}
}
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)));
}
}
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);
}
Aggregations