From 9c3f7f913766cbd6be85062179463eda751d5c3b Mon Sep 17 00:00:00 2001 From: Khurshid Fayzullaev Date: Tue, 8 Apr 2014 19:40:50 -0400 Subject: Update DataServiceImpl.java --- src/org/traccar/web/server/model/DataServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/org/traccar/web/server/model/DataServiceImpl.java b/src/org/traccar/web/server/model/DataServiceImpl.java index af2b81fd..338f2fef 100644 --- a/src/org/traccar/web/server/model/DataServiceImpl.java +++ b/src/org/traccar/web/server/model/DataServiceImpl.java @@ -305,7 +305,7 @@ public class DataServiceImpl extends RemoteServiceServlet implements DataService User user = getSessionUser(); entityManager.getTransaction().begin(); try { - TypedQuery query = entityManager.createQuery("SELECT x FROM Device x WHERE x.id = :id", Device.class); + TypedQuery query = entityManager.createQuery("SELECT x FROM Device x WHERE x.uniqueId = :id", Device.class); query.setParameter("id", device); List results = query.getResultList(); @@ -332,7 +332,7 @@ public class DataServiceImpl extends RemoteServiceServlet implements DataService synchronized (entityManager) { entityManager.getTransaction().begin(); try { - TypedQuery query = entityManager.createQuery("SELECT x FROM Device x WHERE x.id = :id", Device.class); + TypedQuery query = entityManager.createQuery("SELECT x FROM Device x WHERE x.uniqueId = :id", Device.class); query.setParameter("id", device); List results = query.getResultList(); if (results.isEmpty()) { -- cgit v1.2.3