mirror of
https://github.com/traccar/traccar-web.git
synced 2025-01-09 04:37:33 +08:00
Update DataServiceImpl.java
This commit is contained in:
parent
9c3f7f9137
commit
438ee014d2
@ -306,7 +306,7 @@ public class DataServiceImpl extends RemoteServiceServlet implements DataService
|
||||
entityManager.getTransaction().begin();
|
||||
try {
|
||||
TypedQuery<Device> query = entityManager.createQuery("SELECT x FROM Device x WHERE x.uniqueId = :id", Device.class);
|
||||
query.setParameter("id", device);
|
||||
query.setParameter("id", device.getUniqueId());
|
||||
List<Device> results = query.getResultList();
|
||||
|
||||
if (results.isEmpty()) {
|
||||
@ -333,7 +333,7 @@ public class DataServiceImpl extends RemoteServiceServlet implements DataService
|
||||
entityManager.getTransaction().begin();
|
||||
try {
|
||||
TypedQuery<Device> query = entityManager.createQuery("SELECT x FROM Device x WHERE x.uniqueId = :id", Device.class);
|
||||
query.setParameter("id", device);
|
||||
query.setParameter("id", device.getUniqueId());
|
||||
List<Device> results = query.getResultList();
|
||||
if (results.isEmpty()) {
|
||||
device = entityManager.merge(device);
|
||||
|
Loading…
Reference in New Issue
Block a user