/** * Count by base id * * @param userMappingRow user mapping row * @return count */ public int countByBaseId(UserMappingRow userMappingRow) { return countByBaseId(userMappingRow.getBaseId()); }
/** * Delete user mappings by base id * * @param userMappingRow * user mapping row * @return rows deleted */ public int deleteByBaseId(UserMappingRow userMappingRow) { return deleteByBaseId(userMappingRow.getBaseId()); }
/** * Query by base id * * @param userMappingRow user mapping row * @return cursor */ public UserCustomCursor queryByBaseId(UserMappingRow userMappingRow) { return queryByBaseId(userMappingRow.getBaseId()); }
/** * Delete user mappings by base id * * @param userMappingRow user mapping row * @return rows deleted */ public int deleteByBaseId(UserMappingRow userMappingRow) { return deleteByBaseId(userMappingRow.getBaseId()); }
/** * Query by base id * * @param userMappingRow * user mapping row * @return result set */ public UserCustomResultSet queryByBaseId(UserMappingRow userMappingRow) { return queryByBaseId(userMappingRow.getBaseId()); }
/** * Count by base id * * @param userMappingRow * user mapping row * @return count */ public int countByBaseId(UserMappingRow userMappingRow) { return countByBaseId(userMappingRow.getBaseId()); }
/** * Delete user mappings by both base id and related id * * @param userMappingRow user mapping row * @return rows deleted */ public int deleteByIds(UserMappingRow userMappingRow) { return deleteByIds(userMappingRow.getBaseId(), userMappingRow.getRelatedId()); }
/** * Delete user mappings by both base id and related id * * @param userMappingRow * user mapping row * @return rows deleted */ public int deleteByIds(UserMappingRow userMappingRow) { return deleteByIds(userMappingRow.getBaseId(), userMappingRow.getRelatedId()); }
/** * Count by both base id and related id * * @param userMappingRow user mapping row * @return count */ public int countByIds(UserMappingRow userMappingRow) { return countByIds(userMappingRow.getBaseId(), userMappingRow.getRelatedId()); }
/** * Query by both base id and related id * * @param userMappingRow user mapping row * @return cursor */ public UserCustomCursor queryByIds(UserMappingRow userMappingRow) { return queryByIds(userMappingRow.getBaseId(), userMappingRow.getRelatedId()); }
/** * Query by both base id and related id * * @param userMappingRow * user mapping row * @return result set */ public UserCustomResultSet queryByIds(UserMappingRow userMappingRow) { return queryByIds(userMappingRow.getBaseId(), userMappingRow.getRelatedId()); }
/** * Count by both base id and related id * * @param userMappingRow * user mapping row * @return count */ public int countByIds(UserMappingRow userMappingRow) { return countByIds(userMappingRow.getBaseId(), userMappingRow.getRelatedId()); }
/** * Get the base id mappings for the related id * * @param tableName mapping table name * @param relatedId related id * @return IDs representing the matching base IDs */ public List<Long> getMappingsForRelated(String tableName, long relatedId) { List<Long> baseIds = new ArrayList<>(); UserMappingDao userMappingDao = getMappingDao(tableName); UserCustomCursor cursor = userMappingDao .queryByRelatedId(relatedId); try { while (cursor.moveToNext()) { UserMappingRow row = userMappingDao.getRow(cursor); baseIds.add(row.getBaseId()); } } finally { cursor.close(); } return baseIds; }
/** * Get the base id mappings for the related id * * @param tableName * mapping table name * @param relatedId * related id * @return IDs representing the matching base IDs */ public List<Long> getMappingsForRelated(String tableName, long relatedId) { List<Long> baseIds = new ArrayList<>(); UserMappingDao userMappingDao = getMappingDao(tableName); UserCustomResultSet resultSet = userMappingDao .queryByRelatedId(relatedId); try { while (resultSet.moveToNext()) { UserMappingRow row = userMappingDao.getRow(resultSet); baseIds.add(row.getBaseId()); } } finally { resultSet.close(); } return baseIds; }
TestCase.assertTrue(featureIds.contains(resultRow.getBaseId())); TestCase.assertTrue(mediaIds.contains(resultRow.getRelatedId())); RelatedTablesUtils.validateUserRow(mappingColumns, resultRow); userMappingRow = userMappingDao.getRow(mappingCursor); TestCase.assertTrue(featureIds.contains(userMappingRow .getBaseId())); TestCase.assertTrue(mediaIds.contains(userMappingRow .getRelatedId())); userMappingRow = userMappingDao.getRow(mappingCursor); TestCase.assertTrue(featureIds.contains(userMappingRow .getBaseId())); TestCase.assertTrue(mediaIds.contains(userMappingRow .getRelatedId()));
TestCase.assertTrue(attributeIds.contains(resultRow.getBaseId())); TestCase.assertTrue(simpleIds.contains(resultRow.getRelatedId())); RelatedTablesUtils.validateUserRow(mappingColumns, resultRow); userMappingRow = userMappingDao.getRow(mappingCursor); TestCase.assertTrue(attributeIds.contains(userMappingRow .getBaseId())); TestCase.assertTrue(simpleIds.contains(userMappingRow .getRelatedId())); userMappingRow = userMappingDao.getRow(mappingCursor); TestCase.assertTrue(attributeIds.contains(userMappingRow .getBaseId())); TestCase.assertTrue(simpleIds.contains(userMappingRow .getRelatedId()));