Skip to content
Snippets Groups Projects
Commit 6b29e105 authored by Lene Wasskog's avatar Lene Wasskog
Browse files

fix: Pass user ID instead of user object in native query [VIPS-1079]

Fixes a runtime error affecting all logged-in users.The
native SQL query expected a scalar vipsLogicUserId, but
the full user object was mistakenly passed as a parameter.
parent 5d6dadf8
No related branches found
No related tags found
No related merge requests found
...@@ -1112,7 +1112,7 @@ public class ForecastBean { ...@@ -1112,7 +1112,7 @@ public class ForecastBean {
// System.out.println(poi.getName() + " SQL=" + sql); // System.out.println(poi.getName() + " SQL=" + sql);
Query q = em.createNativeQuery(sql); Query q = em.createNativeQuery(sql);
if (user != null) { if (user != null) {
q.setParameter("vipsLogicUserId", user); q.setParameter("vipsLogicUserId", user.getUserId());
} }
q.setParameter("locationPointOfInterestId", poi.getPointOfInterestId()); q.setParameter("locationPointOfInterestId", poi.getPointOfInterestId());
q.setParameter("midnight", midnight); q.setParameter("midnight", midnight);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment