comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadDataFactory.java @ 8089:7e55790da464

Use list() instead of iterator(). Why does this not work?
author Sascha L. Teichmann <teichmann@intevation.de>
date Fri, 15 Aug 2014 18:01:06 +0200
parents fbe3ba5a480e
children 6f3cf934ae99
comparison
equal deleted inserted replaced
8088:b834caf0a4f0 8089:7e55790da464
7 */ 7 */
8 package org.dive4elements.river.artifacts.model.minfo; 8 package org.dive4elements.river.artifacts.model.minfo;
9 9
10 import java.sql.Timestamp; 10 import java.sql.Timestamp;
11 import java.util.HashMap; 11 import java.util.HashMap;
12 import java.util.Iterator; 12 import java.util.List;
13 13
14 import net.sf.ehcache.Cache; 14 import net.sf.ehcache.Cache;
15 import net.sf.ehcache.Element; 15 import net.sf.ehcache.Element;
16 16
17 import org.apache.log4j.Logger; 17 import org.apache.log4j.Logger;
118 int grainFractionIndex = SedimentLoadData.GF_UNKNOWN; 118 int grainFractionIndex = SedimentLoadData.GF_UNKNOWN;
119 119
120 HashMap<Integer, SedimentLoadData.Station> id2station 120 HashMap<Integer, SedimentLoadData.Station> id2station
121 = new HashMap<Integer, SedimentLoadData.Station>(); 121 = new HashMap<Integer, SedimentLoadData.Station>();
122 122
123 for (Iterator iter = sqlQuery.iterate(); iter.hasNext();) { 123 List<Object[]> list = sqlQuery.list();
124 Object [] row = (Object [])iter.next(); 124
125 for (Object [] row: list) {
125 126
126 Integer sl_id = (Integer)row[0]; 127 Integer sl_id = (Integer)row[0];
127 Integer sl_kind = (Integer)row[1]; 128 Integer sl_kind = (Integer)row[1];
128 String sl_description = (String)row[2]; 129 String sl_description = (String)row[2];
129 Timestamp ti_start_time = (Timestamp)row[3]; 130 Timestamp ti_start_time = (Timestamp)row[3];

http://dive4elements.wald.intevation.org