diff options
-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 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<Device> query = entityManager.createQuery("SELECT x FROM Device x WHERE x.id = :id", Device.class); + TypedQuery<Device> query = entityManager.createQuery("SELECT x FROM Device x WHERE x.uniqueId = :id", Device.class); query.setParameter("id", device); List<Device> results = query.getResultList(); @@ -332,7 +332,7 @@ public class DataServiceImpl extends RemoteServiceServlet implements DataService synchronized (entityManager) { entityManager.getTransaction().begin(); try { - TypedQuery<Device> query = entityManager.createQuery("SELECT x FROM Device x WHERE x.id = :id", Device.class); + TypedQuery<Device> query = entityManager.createQuery("SELECT x FROM Device x WHERE x.uniqueId = :id", Device.class); query.setParameter("id", device); List<Device> results = query.getResultList(); if (results.isEmpty()) { |