aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/database')
-rw-r--r--src/org/traccar/database/DataManager.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java
index eb0be9274..3dba215f6 100644
--- a/src/org/traccar/database/DataManager.java
+++ b/src/org/traccar/database/DataManager.java
@@ -472,6 +472,12 @@ public class DataManager implements IdentityManager {
.executeQuery(Position.class);
}
+ public Position getLatestPosition(long deviceId) throws SQLException {
+ return QueryBuilder.create(dataSource, getQuery("database.selectLatestPosition"))
+ .setLong("deviceId", deviceId)
+ .executeQuerySingle(Position.class);
+ }
+
public Server getServer() throws SQLException {
return QueryBuilder.create(dataSource, getQuery("database.selectServers"))
.executeQuerySingle(Server.class);
@@ -482,5 +488,4 @@ public class DataManager implements IdentityManager {
.setObject(server)
.executeUpdate();
}
-
}