aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/web/server/model/DataServiceImpl.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2014-04-16 09:31:57 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2014-04-16 09:31:57 +1200
commit6cd8c5548b0e6934e8b9b72a8a703f9541dd8c99 (patch)
tree857edd8747a5af07bd29487cf3ed0e204e1efb41 /src/org/traccar/web/server/model/DataServiceImpl.java
parent500751368e7f8fc381f720a0c40cd00d8a9914ed (diff)
parent03a0a011c78b215dc1e9fd1326c05df53039f506 (diff)
downloadtrackermap-web-6cd8c5548b0e6934e8b9b72a8a703f9541dd8c99.tar.gz
trackermap-web-6cd8c5548b0e6934e8b9b72a8a703f9541dd8c99.tar.bz2
trackermap-web-6cd8c5548b0e6934e8b9b72a8a703f9541dd8c99.zip
Merge pull request #165 from khfayzullaev/patch-1
Fix updateDevice method
Diffstat (limited to 'src/org/traccar/web/server/model/DataServiceImpl.java')
-rw-r--r--src/org/traccar/web/server/model/DataServiceImpl.java3
1 files changed, 2 insertions, 1 deletions
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<Device> query = entityManager.createQuery("SELECT x FROM Device x WHERE x.uniqueId = :id", Device.class);
+ TypedQuery<Device> 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<Device> results = query.getResultList();