aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-11-30 09:58:48 +0500
committerAbyss777 <abyss@fox5.ru>2016-11-30 09:58:48 +0500
commitd5ec75ecd3697e37782c9dd53998c889d5b9ef4d (patch)
tree22096d3869db469ad556a0e7aeaecd17ad02c6b6 /src/org/traccar/database
parente24b3588647fc1597f31b9bcd26ed9b7378f9f5b (diff)
downloadtraccar-server-d5ec75ecd3697e37782c9dd53998c889d5b9ef4d.tar.gz
traccar-server-d5ec75ecd3697e37782c9dd53998c889d5b9ef4d.tar.bz2
traccar-server-d5ec75ecd3697e37782c9dd53998c889d5b9ef4d.zip
Add API to get positions by Id
Diffstat (limited to 'src/org/traccar/database')
-rw-r--r--src/org/traccar/database/DataManager.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java
index afa8b1677..8be53ad7b 100644
--- a/src/org/traccar/database/DataManager.java
+++ b/src/org/traccar/database/DataManager.java
@@ -280,6 +280,12 @@ public class DataManager {
.executeQuery(Position.class);
}
+ public Position getPosition(long positionId) throws SQLException {
+ return QueryBuilder.create(dataSource, getQuery("database.selectPosition"))
+ .setLong("id", positionId)
+ .executeQuerySingle(Position.class);
+ }
+
public void addPosition(Position position) throws SQLException {
position.setId(QueryBuilder.create(dataSource, getQuery("database.insertPosition"), true)
.setDate("now", new Date())