/** * Get the simple attributes rows that exist with the provided ids * * @param ids list of ids * @return simple attributes rows */ public List<SimpleAttributesRow> getRows(List<Long> ids) { List<SimpleAttributesRow> simpleAttributesRows = new ArrayList<>(); for (long id : ids) { UserCustomRow userCustomRow = queryForIdRow(id); if (userCustomRow != null) { simpleAttributesRows.add(getRow(userCustomRow)); } } return simpleAttributesRows; }
/** * Get a related simple attributes table DAO * * @param tableName simple attributes table name * @return simple attributes DAO */ public SimpleAttributesDao getSimpleAttributesDao(String tableName) { SimpleAttributesDao simpleAttributesDao = new SimpleAttributesDao( getUserDao(tableName)); simpleAttributesDao.registerCursorWrapper(getGeoPackage()); setContents(simpleAttributesDao.getTable()); return simpleAttributesDao; }
/** * Get a related simple attributes table DAO * * @param tableName * simple attributes table name * @return simple attributes DAO */ public SimpleAttributesDao getSimpleAttributesDao(String tableName) { SimpleAttributesDao simpleAttributesDao = new SimpleAttributesDao( getUserDao(tableName)); setContents(simpleAttributesDao.getTable()); return simpleAttributesDao; }
simpleTable = simpleDao.getTable(); TestCase.assertNotNull(simpleTable); validateContents(simpleTable, simpleTable.getContents()); SimpleAttributesRow simpleRow = simpleDao.newRow(); RelatedTablesUtils.populateUserRow(simpleTable, simpleRow, SimpleAttributesTable.requiredColumns()); simpleRowId = simpleDao.create(simpleRow); TestCase.assertTrue(simpleRowId > 0); simpleDao.queryForIdRow(simpleRowId)); SimpleAttributesRow simpleRowCopy = simpleRowToCopy.copy(); long copySimpleRowId = simpleDao.create(simpleRowCopy); TestCase.assertTrue(copySimpleRowId > 0); TestCase.assertEquals(simpleRowId + 1, copySimpleRowId); TestCase.assertEquals(simpleCount, simpleDao.count()); UserCustomCursor simpleCursor = simpleDao.queryForAll(); simpleCount = simpleCursor.getCount(); List<Long> simpleIds = new ArrayList<>(); TestCase.assertEquals(attributesDao.getTable().getPkColumn() .getName(), attributesRelation.getBasePrimaryColumn()); TestCase.assertEquals(simpleDao.getTableName(), attributesRelation.getRelatedTableName()); TestCase.assertEquals(simpleDao.getTable().getPkColumn().getName(), attributesRelation.getRelatedPrimaryColumn()); TestCase.assertEquals(
.newRow(); RelatedTablesUtils.populateUserRow(simpleAttributesRow.getTable(), simpleAttributesRow, DublinCoreType.SOURCE, DublinCoreType.SOURCE.getName() + i); simpleAttributesIds.add(simpleAttributesDao .create(simpleAttributesRow)); .random() * simpleAttributesIds.size())); SimpleAttributesRow simpleAttributesRow = simpleAttributesDao .getRow(simpleAttributesDao .queryForIdRow(randomSimpleRowId));
/** * Get the simple attributes row from the current result set location * * @param resultSet * result set * @return simple attributes row */ public SimpleAttributesRow getRow(UserCustomResultSet resultSet) { return getRow(resultSet.getRow()); }
/** * {@inheritDoc} */ @Override public SimpleAttributesRow newRow() { return new SimpleAttributesRow(getTable()); }
/** * Get the simple attributes row from the current cursor location * * @param cursor cursor * @return simple attributes row */ public SimpleAttributesRow getRow(UserCustomCursor cursor) { return getRow(cursor.getRow()); }
/** * {@inheritDoc} */ @Override public SimpleAttributesRow newRow() { return new SimpleAttributesRow(getTable()); }
/** * Get the simple attributes rows that exist with the provided ids * * @param ids * list of ids * @return simple attributes rows */ public List<SimpleAttributesRow> getRows(List<Long> ids) { List<SimpleAttributesRow> simpleAttributesRows = new ArrayList<>(); for (long id : ids) { UserCustomRow userCustomRow = queryForIdRow(id); if (userCustomRow != null) { simpleAttributesRows.add(getRow(userCustomRow)); } } return simpleAttributesRows; }