/** * {@inheritDoc} */ @Override public AttributesRow newRow() { return new AttributesRow(getTable()); }
/** * {@inheritDoc} */ @Override protected AttributesRow newRow() { return getDao().newRow(); }
TestCase.assertNotNull(dao.getDb()); TestCase.assertEquals(tableName, dao.getTableName()); AttributesTable attributesTable = dao.getTable(); String[] columns = attributesTable.getColumnNames(); AttributesCursor cursor = dao.queryForAll(); int count = cursor.getCount(); int manualCount = 0; cursor = (AttributesCursor) dao.getDatabaseConnection().query(dao.getTableName(), null, null, null, null, null, null); count = cursor.getCount(); .queryForIdRow(attributesRow.getId()); TestCase.assertNotNull(queryAttributesRow); TestCase.assertEquals(attributesRow.getId(), cursor = dao.queryForEq(column1.getName(), column1AttributesValue); TestCase.assertTrue(cursor.getCount() > 0); cursor = dao.queryForValueFieldValues(fieldValues); TestCase.assertTrue(cursor.getCount() > 0); found = false; AttributesRow queryRow = dao.queryForIdRow(rowId); TestCase.assertNotNull(queryRow); TestCase.assertNotNull(queryRow.getTable());
AttributesCursor cursor = dao.queryForAll(); int count = cursor.getCount(); if (count > 0) { long newRowId = dao.create(attributesRow); attributesRow = dao.queryForIdRow(id); TestCase.assertNotNull(attributesRow); AttributesRow queryAttributesRow = dao .queryForIdRow(newRowId); TestCase.assertNotNull(queryAttributesRow); cursor = dao.queryForAll(); TestCase.assertEquals(count + 1, cursor.getCount()); cursor.close(); AttributesRow newRow = dao.newRow(); for (AttributesColumn column : dao.getTable().getColumns()) { long newRowId2 = dao.create(newRow); .queryForIdRow(newRowId2); TestCase.assertNotNull(queryAttributesRow2); cursor = dao.queryForAll(); TestCase.assertEquals(count + 2, cursor.getCount()); cursor.close(); for (AttributesColumn column : dao.getTable().getColumns()) { if (column.getDataType() == GeoPackageDataType.BLOB) { byte[] blob1 = (byte[]) queryAttributesRow2
AttributesCursor attributesCursor = attributesDao.queryForAll(); int attributesCount = attributesCursor.getCount(); List<Long> attributeIds = new ArrayList<>(); .getBaseTableRelations(attributesDao.getTableName()); List<ExtendedRelation> attributesExtendedRelations2 = extendedRelationsDao .getTableRelations(attributesDao.getTableName()); TestCase.assertEquals(1, attributesExtendedRelations.size()); TestCase.assertEquals(1, attributesExtendedRelations2.size()); attributesExtendedRelations2.get(0).getId()); TestCase.assertTrue(extendedRelationsDao.getRelatedTableRelations( attributesDao.getTableName()).isEmpty()); TestCase.assertEquals(attributesDao.getTableName(), attributesRelation.getBaseTableName()); TestCase.assertEquals(attributesDao.getTable().getPkColumn() .getName(), attributesRelation.getBasePrimaryColumn()); TestCase.assertEquals(simpleDao.getTableName(), attributesCursor = attributesDao.queryForAll(); int totalMapped = 0; while (attributesCursor.moveToNext()) { TestCase.assertEquals(attributesDao.getTableName(), simpleRelation.getBaseTableName()); TestCase.assertEquals(attributesDao.getTable().getPkColumn() .getName(), simpleRelation.getBasePrimaryColumn()); TestCase.assertEquals(simpleDao.getTableName(),
AttributesCursor cursor = dao.queryForAll(); int count = cursor.getCount(); if (count > 0) { for (AttributesColumn attributesColumn : dao.getTable() .getColumns()) { if (!attributesColumn.isPrimaryKey()) { TestCase.assertEquals(1, dao.update(attributesRow)); AttributesRow readRow = dao.queryForIdRow(id); TestCase.assertNotNull(readRow); TestCase.assertEquals(originalRow.getId(), readRow.getId());
AttributesDao relatedDao = geoPackage .getAttributesDao(extendedRelation.getRelatedTableName()); AttributesColumn pkColumn2 = relatedDao.getTable().getPkColumn(); AttributesCursor ars = relatedDao.queryForAll(); while (ars.moveToNext()) { long relatedId = ars.getLong(pkColumn2.getIndex());
TestCase.assertNotNull(dao); AttributesCursor cursor = dao.queryForAll(); int count = cursor.getCount(); if (count > 0) { TestCase.assertEquals(1, dao.delete(attributesRow)); .queryForIdRow(attributesRow.getId()); TestCase.assertNull(queryAttributesRow); cursor = dao.queryForAll(); TestCase.assertEquals(count - 1, cursor.getCount()); cursor.close();
/** * {@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; }
AttributesDao attributesDao = geoPackage.getAttributesDao(tableName); AttributesCursor attributesCursor = attributesDao.queryForAll(); while (attributesCursor.moveToNext()) { AttributesRow attributesRow = attributesCursor.getRow();
attributesTable.setContents(contents); AttributesConnection userDb = new AttributesConnection(database); AttributesDao dao = new AttributesDao(getName(), database, userDb, attributesTable);
/** * {@inheritDoc} */ @Override public AttributesRow newRow() { return new AttributesRow(getTable()); }
/** * {@inheritDoc} */ @Override protected AttributesRow newRow() { return getDao().newRow(); }