Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentDensityFactory.java @ 6947:51f28e5417ee
Cosmetics.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Fri, 30 Aug 2013 09:45:04 +0200 |
parents | af13ceeba52a |
children | 1750b4448c0c |
comparison
equal
deleted
inserted
replaced
6946:30c7e6c3e701 | 6947:51f28e5417ee |
---|---|
77 double startKm, | 77 double startKm, |
78 double endKm, | 78 double endKm, |
79 int year | 79 int year |
80 ) { | 80 ) { |
81 log.debug("getSedimentDensityUncached"); | 81 log.debug("getSedimentDensityUncached"); |
82 List<Object[]> results = null; | |
83 Session session = SessionHolder.HOLDER.get(); | 82 Session session = SessionHolder.HOLDER.get(); |
84 SQLQuery sqlQuery = session.createSQLQuery(SQL_SELECT_DENSITY) | 83 SQLQuery sqlQuery = session.createSQLQuery(SQL_SELECT_DENSITY) |
85 .addScalar("km", StandardBasicTypes.DOUBLE) | 84 .addScalar("km", StandardBasicTypes.DOUBLE) |
86 .addScalar("density", StandardBasicTypes.DOUBLE) | 85 .addScalar("density", StandardBasicTypes.DOUBLE) |
87 .addScalar("year", StandardBasicTypes.INTEGER); | 86 .addScalar("year", StandardBasicTypes.INTEGER); |
88 sqlQuery.setString("name", river); | 87 sqlQuery.setString("name", river); |
89 results = sqlQuery.list(); | 88 List<Object[]> results = sqlQuery.list(); |
90 SedimentDensity density = new SedimentDensity(); | 89 SedimentDensity density = new SedimentDensity(); |
91 for (Object[] row : results) { | 90 for (Object[] row : results) { |
92 if (row[0] != null && row[1] != null && row[2] != null) { | 91 if (row[0] != null && row[1] != null && row[2] != null) { |
93 density.addDensity((Double)row[0], (Double)row[1], (Integer)row[2]); | 92 density.addDensity((Double)row[0], (Double)row[1], (Integer)row[2]); |
94 } | 93 } |
96 | 95 |
97 density.cleanUp(); | 96 density.cleanUp(); |
98 return density; | 97 return density; |
99 } | 98 } |
100 } | 99 } |
100 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |