/** * {@inheritDoc} */ @Override protected AttributesTable createTable(String tableName, List<AttributesColumn> columnList) { return new AttributesTable(tableName, columnList); }
/** * Constructor * * @param database database * @param db db connection * @param attributesDb attributes connection * @param table attributes table */ public AttributesDao(String database, GeoPackageConnection db, AttributesConnection attributesDb, AttributesTable table) { super(database, db, attributesDb, table); this.attributesDb = attributesDb; if (table.getContents() == null) { throw new GeoPackageException(AttributesTable.class.getSimpleName() + " " + table.getTableName() + " has null " + Contents.class.getSimpleName()); } }
AttributesTable table = new AttributesTable(tableName, columns); table.addUniqueConstraints(uniqueConstraints); table.setContents(contents);
contents.getTableName()); final AttributesTable attributesTable = tableReader.readTable(new AttributesWrapperConnection(database)); attributesTable.setContents(contents); AttributesConnection userDb = new AttributesConnection(database); AttributesDao dao = new AttributesDao(getName(), database, userDb, registerCursorWrapper(attributesTable.getTableName(), new GeoPackageCursorWrapper() {
.createAttributesTableWithId("test_attributes", columns); TestCase.assertNotNull(attributesTable); Contents attributesContents = attributesTable.getContents(); TestCase.assertNotNull(attributesContents); TestCase.assertEquals(ContentsDataType.ATTRIBUTES, attributesContents.getTableName()); TestCase.assertEquals(attributesContents.getTableName(), attributesTable.getTableName()); .getAttributesDao(attributesTable.getTableName()); for (AttributesColumn column : attributesTable.getColumns()) { if (!column.isPrimaryKey()) { attributesReference.setTableName(attributesTable.getTableName()); attributesReference.setRowIdValue(rowId); attributesReference.setTimestamp(new Date());
TestCase.assertEquals(attributesDao.getTableName(), attributesRelation.getBaseTableName()); TestCase.assertEquals(attributesDao.getTable().getPkColumn() .getName(), attributesRelation.getBasePrimaryColumn()); TestCase.assertEquals(simpleDao.getTableName(), TestCase.assertEquals(attributesDao.getTableName(), simpleRelation.getBaseTableName()); TestCase.assertEquals(attributesDao.getTable().getPkColumn() .getName(), simpleRelation.getBasePrimaryColumn()); TestCase.assertEquals(simpleDao.getTableName(), AttributesTable attributesTable = attributesDao.getTable(); TestCase.assertNotNull(attributesTable); Contents attributesContents = attributesTable.getContents(); TestCase.assertNotNull(attributesContents); TestCase.assertEquals(ContentsDataType.ATTRIBUTES, TestCase.assertEquals(ContentsDataType.ATTRIBUTES.getName(), attributesContents.getDataTypeString()); TestCase.assertEquals(attributesTable.getTableName(), attributesContents.getTableName()); TestCase.assertNotNull(attributesContents.getLastChange());
String[] columns = attributesTable.getColumnNames(); AttributesColumn column2 = null; for (AttributesColumn column : attributesRow.getTable() .getColumns()) { if (!column.isPrimaryKey() && column.getDataType() != GeoPackageDataType.BLOB) { if (column1 == null) { List<MetadataReference> references = referenceDao.queryForEq( MetadataReference.COLUMN_TABLE_NAME, attributesTable.getTableName()); if (references != null && !references.isEmpty()) { Metadata metadata = references.get(0).getMetadata(); TestCase.assertNotNull(queryRow); TestCase.assertNotNull(queryRow.getTable()); TestCase.assertEquals(attributesTable.getTableName(), queryRow.getTable().getTableName());
/** * {@inheritDoc} */ @Override public AttributesDao getAttributesDao(Contents contents) { if (contents == null) { throw new GeoPackageException("Non null " + Contents.class.getSimpleName() + " is required to create " + AttributesDao.class.getSimpleName()); } if (contents.getDataType() != ContentsDataType.ATTRIBUTES) { throw new GeoPackageException(Contents.class.getSimpleName() + " is required to be of type " + ContentsDataType.ATTRIBUTES + ". Actual: " + contents.getDataTypeString()); } // Read the existing table and create the dao AttributesTableReader tableReader = new AttributesTableReader( contents.getTableName()); AttributesConnection userDb = new AttributesConnection(database); final AttributesTable attributesTable = tableReader.readTable(userDb); attributesTable.setContents(contents); AttributesDao dao = new AttributesDao(getName(), database, userDb, attributesTable); return dao; }
.getAttributesDao(attributesTable.getTableName());
AttributesColumn column = attributesRow.getTable().getColumns() .get(i); GeoPackageDataType dataType = column.getDataType();
AttributesDao relatedDao = geoPackage .getAttributesDao(extendedRelation.getRelatedTableName()); AttributesColumn pkColumn2 = relatedDao.getTable().getPkColumn(); AttributesCursor ars = relatedDao.queryForAll(); while (ars.moveToNext()) {
.getColumns()) { if (!attributesColumn.isPrimaryKey()) {
/** * Constructor * * @param database * database * @param db * db connection * @param attributesDb * attributes connection * @param table * attributes table */ public AttributesDao(String database, GeoPackageConnection db, AttributesConnection attributesDb, AttributesTable table) { super(database, db, attributesDb, table); this.attributesDb = attributesDb; if (table.getContents() == null) { throw new GeoPackageException(AttributesTable.class.getSimpleName() + " " + table.getTableName() + " has null " + Contents.class.getSimpleName()); } }
/** * {@inheritDoc} */ @Override protected AttributesTable createTable(String tableName, List<AttributesColumn> columnList) { return new AttributesTable(tableName, columnList); }
for (AttributesColumn column : dao.getTable().getColumns()) { for (AttributesColumn column : dao.getTable().getColumns()) { if (column.getDataType() == GeoPackageDataType.BLOB) { byte[] blob1 = (byte[]) queryAttributesRow2 cursor.close(); for (AttributesColumn column : dao.getTable().getColumns()) { if (column.isPrimaryKey()) { TestCase.assertNotSame(queryAttributesRow2