Skip to content
Snippets Groups Projects
Commit eac048f0 authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

Bugfix: Make sure deletion of forecast summaries works also when there are no

active forecasts
parent b9094a6f
No related branches found
No related tags found
No related merge requests found
......@@ -868,11 +868,19 @@ public class ForecastBean {
}
}
// Delete all summaries from not active forecasts
em.createNativeQuery("DELETE FROM forecast_summary "
+ "WHERE forecast_configuration_id NOT IN :activeForecastIds")
.setParameter("activeForecastIds", activeForecastIds)
.executeUpdate();
if(activeForecastIds != null && ! activeForecastIds.isEmpty())
{
// Delete all summaries from not active forecasts
em.createNativeQuery("DELETE FROM forecast_summary "
+ "WHERE forecast_configuration_id NOT IN :activeForecastIds")
.setParameter("activeForecastIds", activeForecastIds)
.executeUpdate();
}
else
{
em.createNativeQuery("TRUNCATE forecast_summary").executeUpdate();
}
}
public List<ForecastConfiguration> getForecastConfigurationWithSummaries(List<Long> forecastConfigurationIds)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment