diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/web/server/model/DataServiceImpl.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/org/traccar/web/server/model/DataServiceImpl.java b/src/org/traccar/web/server/model/DataServiceImpl.java index 338f2fef..9706eb1b 100644 --- a/src/org/traccar/web/server/model/DataServiceImpl.java +++ b/src/org/traccar/web/server/model/DataServiceImpl.java @@ -306,7 +306,7 @@ public class DataServiceImpl extends RemoteServiceServlet implements DataService entityManager.getTransaction().begin(); try { TypedQuery<Device> query = entityManager.createQuery("SELECT x FROM Device x WHERE x.uniqueId = :id", Device.class); - query.setParameter("id", device); + query.setParameter("id", device.getUniqueId()); List<Device> results = query.getResultList(); if (results.isEmpty()) { @@ -333,7 +333,7 @@ public class DataServiceImpl extends RemoteServiceServlet implements DataService entityManager.getTransaction().begin(); try { TypedQuery<Device> query = entityManager.createQuery("SELECT x FROM Device x WHERE x.uniqueId = :id", Device.class); - query.setParameter("id", device); + query.setParameter("id", device.getUniqueId()); List<Device> results = query.getResultList(); if (results.isEmpty()) { device = entityManager.merge(device); |