aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/org/traccar/web/server/model/DataServiceImpl.java4
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 af2b81f..338f2fe 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()) {