From 03a0a011c78b215dc1e9fd1326c05df53039f506 Mon Sep 17 00:00:00 2001 From: Khurshid Fayzullaev Date: Tue, 15 Apr 2014 15:57:58 -0400 Subject: Update DataServiceImpl.java --- src/org/traccar/web/server/model/DataServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/org/traccar/web/server/model/DataServiceImpl.java b/src/org/traccar/web/server/model/DataServiceImpl.java index d1a6eec9..fb8724ae 100644 --- a/src/org/traccar/web/server/model/DataServiceImpl.java +++ b/src/org/traccar/web/server/model/DataServiceImpl.java @@ -331,7 +331,8 @@ public class DataServiceImpl extends RemoteServiceServlet implements DataService EntityManager entityManager = getSessionEntityManager(); synchronized (entityManager) { - TypedQuery query = entityManager.createQuery("SELECT x FROM Device x WHERE x.uniqueId = :id", Device.class); + TypedQuery query = entityManager.createQuery("SELECT x FROM Device x WHERE x.uniqueId = :id AND x.id <> :primary_id", Device.class); + query.setParameter("primary_id", device.getId()); query.setParameter("id", device.getUniqueId()); List results = query.getResultList(); -- cgit v1.2.3