Mercurial > dive4elements > river
changeset 7212:8079e3ba31c9
SedimentDensityFactory: query densities by id only (not year).
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Mon, 30 Sep 2013 17:38:11 +0200 |
parents | d6030c90b312 |
children | c453f7ecf479 |
files | artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentDensityFactory.java |
diffstat | 1 files changed, 3 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentDensityFactory.java Mon Sep 30 17:36:44 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentDensityFactory.java Mon Sep 30 17:38:11 2013 +0200 @@ -46,7 +46,7 @@ " sdv.year AS year " + " FROM sediment_density sd" + " JOIN sediment_density_values sdv ON sd.id = sdv.sediment_density_id" + - " WHERE sdv.year = :year AND sd.id = :id"; + " WHERE sd.id = :id"; private SedimentDensityFactory() {} @@ -107,17 +107,15 @@ } public static SedimentDensity getSedimentDensityUncached( - int id, - int year + int id ) { log.debug("getSedimentDensityUncached id/year"); Session session = SessionHolder.HOLDER.get(); - SQLQuery sqlQuery = session.createSQLQuery(SQL_SELECT_DENSITY) + SQLQuery sqlQuery = session.createSQLQuery(SQL_SELECT_DENSITY_BY_ID_YEAR) .addScalar("km", StandardBasicTypes.DOUBLE) .addScalar("density", StandardBasicTypes.DOUBLE) .addScalar("year", StandardBasicTypes.INTEGER); sqlQuery.setInteger("id", id); - sqlQuery.setInteger("year", year); List<Object[]> results = sqlQuery.list(); SedimentDensity density = new SedimentDensity(); for (Object[] row : results) {