/** * Get a related simple attributes table DAO * * @param simpleAttributesTable * simple attributes table * @return simple attributes DAO */ public SimpleAttributesDao getSimpleAttributesDao( SimpleAttributesTable simpleAttributesTable) { return getSimpleAttributesDao(simpleAttributesTable.getTableName()); }
/** * Get a related simple attributes table DAO * * @param simpleAttributesTable simple attributes table * @return simple attributes DAO */ public SimpleAttributesDao getSimpleAttributesDao( SimpleAttributesTable simpleAttributesTable) { return getSimpleAttributesDao(simpleAttributesTable.getTableName()); }
/** * Validate contents * * @param simpleAttributesTable simple attributes table * @param contents contents */ private static void validateContents( SimpleAttributesTable simpleAttributesTable, Contents contents) { TestCase.assertNotNull(contents); TestCase.assertNotNull(contents.getDataType()); TestCase.assertEquals( SimpleAttributesTable.RELATION_TYPE.getDataType(), contents .getDataType().getName()); TestCase.assertEquals( SimpleAttributesTable.RELATION_TYPE.getDataType(), contents.getDataTypeString()); TestCase.assertEquals(simpleAttributesTable.getTableName(), contents.getTableName()); TestCase.assertNotNull(contents.getLastChange()); }
simpleTable.getTableName())); ExtendedRelation extendedRelation = rte .addSimpleAttributesRelationship(baseTableName, simpleTable, mappingTableName)); TestCase.assertTrue(geoPackage.getDatabase().tableExists( simpleTable.getTableName())); TestCase.assertTrue(contentsDao.getTables().contains( simpleTable.getTableName())); validateContents(simpleTable, contentsDao.queryForId(simpleTable.getTableName())); TestCase.assertEquals(SimpleAttributesTable.RELATION_TYPE.getDataType(), geoPackage.getTableType(simpleTable.getTableName())); TestCase.assertTrue(geoPackage.isTableType( SimpleAttributesTable.RELATION_TYPE.getDataType(), simpleTable.getTableName())); .getRelatedTableRelations(simpleTable.getTableName()); List<ExtendedRelation> simpleExtendedRelations2 = extendedRelationsDao .getTableRelations(simpleTable.getTableName()); TestCase.assertEquals(1, simpleExtendedRelations.size()); TestCase.assertEquals(1, simpleExtendedRelations2.size()); simpleExtendedRelations2.get(0).getId()); TestCase.assertTrue(extendedRelationsDao.getBaseTableRelations( simpleTable.getTableName()).isEmpty()); TestCase.assertTrue(geoPackage.isTable(simpleTable.getTableName())); TestCase.assertNotNull(contentsDao.queryForId(simpleTable
.numRequiredColumns()); UserMappingTable userMappingTable = UserMappingTable.create(tableName + "_" + simpleTable.getTableName(), additionalMappingColumns); ExtendedRelation relation = relatedTables .addSimpleAttributesRelationship(tableName, simpleTable,