From 438ee014d2b786e634049068b3e866e357e1aafe Mon Sep 17 00:00:00 2001 From: Khurshid Fayzullaev Date: Tue, 8 Apr 2014 19:45:40 -0400 Subject: Update DataServiceImpl.java --- src/org/traccar/web/server/model/DataServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/org/traccar') 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 query = entityManager.createQuery("SELECT x FROM Device x WHERE x.uniqueId = :id", Device.class); - query.setParameter("id", device); + query.setParameter("id", device.getUniqueId()); List results = query.getResultList(); if (results.isEmpty()) { @@ -333,7 +333,7 @@ public class DataServiceImpl extends RemoteServiceServlet implements DataService entityManager.getTransaction().begin(); try { TypedQuery query = entityManager.createQuery("SELECT x FROM Device x WHERE x.uniqueId = :id", Device.class); - query.setParameter("id", device); + query.setParameter("id", device.getUniqueId()); List results = query.getResultList(); if (results.isEmpty()) { device = entityManager.merge(device); -- cgit v1.2.3