Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/services/SedimentLoadInfoService.java @ 8239:b207eeb66edd
(issue1448) Objectify sq_time_interval id.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Mon, 08 Sep 2014 19:47:01 +0200 |
parents | 0bf888783683 |
children | f8ea1a7ecde6 |
comparison
equal
deleted
inserted
replaced
8238:be3c11bef6e8 | 8239:b207eeb66edd |
---|---|
90 } else if (type.equals("sq_time_intervals")) { | 90 } else if (type.equals("sq_time_intervals")) { |
91 loads = allLoadData.findUniqueTimeIntervalLoads(fromD, toD); | 91 loads = allLoadData.findUniqueTimeIntervalLoads(fromD, toD); |
92 | 92 |
93 for (Iterator<Load> it = loads.iterator(); it.hasNext();) { | 93 for (Iterator<Load> it = loads.iterator(); it.hasNext();) { |
94 /* Skip loads without time interval for this info type. */ | 94 /* Skip loads without time interval for this info type. */ |
95 if (it.next().getSQRelationTimeIntervalId() == 0) { | 95 if (it.next().getSQRelationTimeIntervalId() == null) { |
96 it.remove(); | 96 it.remove(); |
97 } | 97 } |
98 } | 98 } |
99 } else { | 99 } else { |
100 if (!sq_ti_id.isEmpty()) { | 100 if (!sq_ti_id.isEmpty()) { |
101 int id = Integer.parseInt(sq_ti_id); | 101 Integer id = Integer.parseInt(sq_ti_id); |
102 log.debug("Finding only items for id"); | 102 log.debug("Finding only items for id"); |
103 loads = allLoadData.findLoads(fromD, toD, id); | 103 loads = allLoadData.findLoads(fromD, toD, id); |
104 } else { | 104 } else { |
105 log.debug("Finding everything."); | 105 log.debug("Finding everything."); |
106 loads = allLoadData.findLoads(fromD, toD); | 106 loads = allLoadData.findLoads(fromD, toD); |
133 ele.setAttribute( | 133 ele.setAttribute( |
134 "date", | 134 "date", |
135 String.valueOf(calendar.get(Calendar.YEAR))); | 135 String.valueOf(calendar.get(Calendar.YEAR))); |
136 } | 136 } |
137 /* SQ Time interval */ | 137 /* SQ Time interval */ |
138 if (load.getSQRelationTimeIntervalId() != 0) { | 138 if (load.getSQRelationTimeIntervalId() != null) { |
139 ele.setAttribute("sq_ti_id", String.valueOf(load.getSQRelationTimeIntervalId())); | 139 ele.setAttribute("sq_ti_id", String.valueOf(load.getSQRelationTimeIntervalId())); |
140 Date start = load.getSQStartTime(); | 140 Date start = load.getSQStartTime(); |
141 Date stop = load.getSQStopTime(); | 141 Date stop = load.getSQStopTime(); |
142 if (start != null && stop != null) { | 142 if (start != null && stop != null) { |
143 Calendar calendarS = Calendar.getInstance(); | 143 Calendar calendarS = Calendar.getInstance(); |