/** * Copy the row * * @return row copy * @since 3.0.1 */ public AttributesRow copy() { return new AttributesRow(this); }
TestCase.assertEquals(columns.length, attributesRow.columnCount()); for (int i = 0; i < attributesRow.columnCount(); i++) { AttributesColumn column = attributesRow.getTable().getColumns() .get(i); GeoPackageDataType dataType = column.getDataType(); TestCase.assertEquals(i, column.getIndex()); TestCase.assertEquals(columns[i], attributesRow.getColumnName(i)); TestCase.assertEquals(i, attributesRow.getColumnIndex(columns[i])); int rowType = attributesRow.getRowColumnType(i); Object value = attributesRow.getValue(i); TestCase.assertTrue(attributesRow.getId() >= 0);
attributesRow.setValue( attributesRow.getPkColumnIndex(), 9); TestCase.fail("Updated the primary key value"); } catch (GeoPackageException e) { .getRowColumnType(attributesColumn .getIndex())) { attributesRow.setValue( attributesColumn.getIndex(), updatedDate); } else { attributesRow.setValue( attributesColumn.getIndex(), converter.stringValue(updatedDate)); attributesRow.setValue( attributesColumn.getIndex(), updatedLimitedString); } else { attributesRow.setValue( attributesColumn.getIndex(), updatedString); if (updatedBoolean == null) { updatedBoolean = !((Boolean) attributesRow .getValue(attributesColumn .getIndex()));
long id = attributesRow.getId(); attributesRow.resetId(); long newRowId = dao.create(attributesRow); TestCase.assertEquals(newRowId, attributesRow.getId()); newRow.setValue(column.getName(), 10); TestCase.fail("Set primary key on new row"); } catch (GeoPackageException e) { newRow.setValue(column.getName(), attributesRow.getValue(column.getName())); TestCase.assertEquals(newRowId2, newRow.getId()); AttributesRow copyRow = queryAttributesRow2.copy(); for (AttributesColumn column : dao.getTable().getColumns()) { if (column.getDataType() == GeoPackageDataType.BLOB) { byte[] blob1 = (byte[]) queryAttributesRow2 .getValue(column.getName()); byte[] blob2 = (byte[]) copyRow.getValue(column .getName()); if (blob1 == null) { .getValue(column.getName()), copyRow .getValue(column.getName())); copyRow.resetId();
.queryForIdRow(attributesRow.getId()); TestCase.assertNotNull(queryAttributesRow); TestCase.assertEquals(attributesRow.getId(), queryAttributesRow.getId()); for (AttributesColumn column : attributesRow.getTable() .getColumns()) { if (!column.isPrimaryKey() && column.getDataType() != GeoPackageDataType.BLOB) { Object column1Value = attributesRow.getValue(column1 .getName()); Class<?> column1ClassType = column1.getDataType() queryAttributesRow = cursor.getRow(); TestCase.assertEquals(column1Value, queryAttributesRow.getValue(column1.getName())); if (!found) { found = attributesRow.getId() == queryAttributesRow .getId(); if (column2 != null) { column2Value = attributesRow .getValue(column2.getName()); Class<?> column2ClassType = column2.getDataType() .getClassType(); queryAttributesRow = cursor.getRow(); TestCase.assertEquals(column1Value, queryAttributesRow.getValue(column1.getName()));
List<Long> attributeIds = new ArrayList<>(); while (attributesCursor.moveToNext()) { attributeIds.add(attributesCursor.getRow().getId()); AttributesRow attributesRow = attributesCursor.getRow(); List<Long> mappedIds = rte.getMappingsForBase( attributesRelation, attributesRow.getId()); List<SimpleAttributesRow> simpleRows = simpleDao .getRows(mappedIds); TestCase.assertNotNull(attributesRow); TestCase.assertTrue(attributesRow.hasId()); TestCase.assertTrue(attributesRow.getId() >= 0); TestCase.assertTrue(attributeIds.contains(attributesRow .getId())); TestCase.assertTrue(mappedIds.contains(attributesRow .getId()));
userMappingRow.setBaseId(attributesRow.getId()); userMappingRow.setRelatedId(simpleAttributesRow.getId()); RelatedTablesUtils.populateUserRow(userMappingDao.getTable(), userMappingRow, UserMappingTable.requiredColumns()); String attributesName = attributesRow.getValue(TEXT_COLUMN) .toString(); DublinCoreMetadata.setValue(
.queryForIdRow(attributesRow.getId()); TestCase.assertNull(queryAttributesRow); cursor = dao.queryForAll();
/** * Copy the row * * @return row copy * @since 3.0.1 */ public AttributesRow copy() { return new AttributesRow(this); }
/** * {@inheritDoc} */ @Override public AttributesRow newRow() { return new AttributesRow(getTable()); }
/** * {@inheritDoc} */ @Override public AttributesRow newRow() { return new AttributesRow(getTable()); }
/** * {@inheritDoc} */ @Override public AttributesRow getRow(int[] columnTypes, Object[] values) { return new AttributesRow(getTable(), columnTypes, values); }
/** * {@inheritDoc} */ @Override public AttributesRow getRow(int[] columnTypes, Object[] values) { return new AttributesRow(getTable(), columnTypes, values); }