diff options
author | Anton Tananaev <anton@traccar.org> | 2022-06-04 06:33:02 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-06-04 06:33:02 -0700 |
commit | ec76482c15094a7e04964c67d3011a7e8e1ad6a9 (patch) | |
tree | 3ef0d23e1b9f4ba7ef02f68b08db33f3db1972ab /src/main/java/org/traccar/database/DataManager.java | |
parent | 4030d3207c157a3fcee2653c18440898b6b2a2e6 (diff) | |
download | trackermap-server-ec76482c15094a7e04964c67d3011a7e8e1ad6a9.tar.gz trackermap-server-ec76482c15094a7e04964c67d3011a7e8e1ad6a9.tar.bz2 trackermap-server-ec76482c15094a7e04964c67d3011a7e8e1ad6a9.zip |
Refactor commands manager
Diffstat (limited to 'src/main/java/org/traccar/database/DataManager.java')
-rw-r--r-- | src/main/java/org/traccar/database/DataManager.java | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/main/java/org/traccar/database/DataManager.java b/src/main/java/org/traccar/database/DataManager.java index b5966ca9e..1426daea3 100644 --- a/src/main/java/org/traccar/database/DataManager.java +++ b/src/main/java/org/traccar/database/DataManager.java @@ -50,8 +50,6 @@ import java.lang.reflect.Method; import java.net.URL; import java.util.Collection; import java.util.Date; -import java.util.LinkedList; -import java.util.List; public class DataManager { @@ -205,14 +203,9 @@ public class DataManager { } public Collection<Position> getLatestPositions() throws StorageException { - List<Position> positions = new LinkedList<>(); - List<Device> devices = storage.getObjects(Device.class, new Request(new Columns.Include("positionId"))); - for (Device device : devices) { - positions.addAll(storage.getObjects(Position.class, new Request( - new Columns.All(), - new Condition.Equals("id", "id", device.getPositionId())))); - } - return positions; + return storage.getObjects(Position.class, new Request( + new Columns.All(), + new Condition.LatestPositions())); } public Server getServer() throws StorageException { |