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

Include deletion of referencing rows in messaging.forecast_notification_log...

Include deletion of referencing rows in messaging.forecast_notification_log before deleting forecast_configuration
parent 1dc13447
Branches
No related tags found
No related merge requests found
...@@ -675,6 +675,10 @@ public class ForecastBean { ...@@ -675,6 +675,10 @@ public class ForecastBean {
q = em.createNativeQuery("DELETE FROM public.forecast_summary WHERE forecast_configuration_id=:forecastConfigurationId"); q = em.createNativeQuery("DELETE FROM public.forecast_summary WHERE forecast_configuration_id=:forecastConfigurationId");
q.setParameter("forecastConfigurationId", forecastConfiguration.getForecastConfigurationId()); q.setParameter("forecastConfigurationId", forecastConfiguration.getForecastConfigurationId());
q.executeUpdate(); q.executeUpdate();
// Entries in ForecastNotificationLog referencing the ForecastConfiguration must also be deleted
q = em.createNativeQuery("DELETE FROM messaging.forecast_notification_log WHERE forecast_configuration_id=:forecastConfigurationId");
q.setParameter("forecastConfigurationId", forecastConfiguration.getForecastConfigurationId());
q.executeUpdate();
em.remove(forecastConfiguration); em.remove(forecastConfiguration);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment