private void addWaterlevels(final Session session, final GafProfile profile, final GafPart part) { if (m_waterlevelEvent == null) return; final GafKind kind = part.getKind(); if (!GafKind.W.equals(kind)) return; final GafPoint[] points = part.getPoints(); for (final GafPoint point : points) { final WaterlevelFixation fixation = new WaterlevelFixation(); fixation.setEvent(m_waterlevelEvent); fixation.setDescription(StringUtils.EMPTY); fixation.setCreationDate(m_waterlevelEvent.getCreationDate()); fixation.setEditingDate(m_waterlevelEvent.getEditingDate()); fixation.setEditingUser(m_waterlevelEvent.getEditingUser()); fixation.setMeasurementDate(m_waterlevelEvent.getMeasurementDate()); fixation.setLocation(point.getPoint()); fixation.setStation(profile.getStation()); fixation.setWaterlevel(point.getHeight()); m_waterlevelEvent.getWaterlevelFixations().add(fixation); session.save(fixation); } }
private void commitWaterLevel(final Session session) { if (m_waterlevelEvent != null) { m_waterlevelEvent.setCreationDate(m_state.getCreationDate()); m_waterlevelEvent.setEditingDate(m_state.getEditingDate()); m_waterlevelEvent.setEditingUser(m_state.getEditingUser()); m_waterlevelEvent.setMeasurementDate(m_state.getMeasurementDate()); m_waterlevelEvent.setWaterBody(m_waterBody); m_waterlevelEvent.setState(m_state); session.save(m_waterlevelEvent); } }