/** * {@inheritDoc} */ @Override public TileDao getTileDao(String tableName) { TileMatrixSetDao dao = getTileMatrixSetDao(); List<TileMatrixSet> tileMatrixSetList; try { tileMatrixSetList = dao.queryForEq(TileMatrixSet.COLUMN_TABLE_NAME, tableName); } catch (SQLException e) { throw new GeoPackageException("Failed to retrieve " + TileDao.class.getSimpleName() + " for table name: " + tableName + ". Exception retrieving " + TileMatrixSet.class.getSimpleName() + ".", e); } if (tileMatrixSetList.isEmpty()) { throw new GeoPackageException( "No Tile Table exists for table name: " + tableName); } else if (tileMatrixSetList.size() > 1) { // This shouldn't happen with the table name primary key on tile // matrix set table throw new GeoPackageException("Unexpected state. More than one " + TileMatrixSet.class.getSimpleName() + " matched for table name: " + tableName + ", count: " + tileMatrixSetList.size()); } return getTileDao(tileMatrixSetList.get(0)); }
/** * {@inheritDoc} */ @Override public TileDao getTileDao(String tableName) { TileMatrixSetDao dao = getTileMatrixSetDao(); List<TileMatrixSet> tileMatrixSetList; try { tileMatrixSetList = dao.queryForEq(TileMatrixSet.COLUMN_TABLE_NAME, tableName); } catch (SQLException e) { throw new GeoPackageException("Failed to retrieve " + TileDao.class.getSimpleName() + " for table name: " + tableName + ". Exception retrieving " + TileMatrixSet.class.getSimpleName() + ".", e); } if (tileMatrixSetList.isEmpty()) { throw new GeoPackageException( "No Tile Table exists for table name: " + tableName + ", Tile Tables: " + getTileTables()); } else if (tileMatrixSetList.size() > 1) { // This shouldn't happen with the table name primary key on tile // matrix set table throw new GeoPackageException("Unexpected state. More than one " + TileMatrixSet.class.getSimpleName() + " matched for table name: " + tableName + ", count: " + tileMatrixSetList.size()); } return getTileDao(tileMatrixSetList.get(0)); }
List<TileMatrixSet> queryTileMatrixSetList = dao.queryForEq( TileMatrixSet.COLUMN_SRS_ID, tileMatrixSet.getSrsId()); TestCase.assertNotNull(queryTileMatrixSetList);