aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-11-30 18:39:19 +1300
committerGitHub <noreply@github.com>2016-11-30 18:39:19 +1300
commiteb1373894ae52054403625ef1261f3399272f5a7 (patch)
treebe55e2eff98307745633b6149ebe4b294e5d1d70 /src/org/traccar/database
parent137adb0507cacb77c7180d06526f5258f857de57 (diff)
parentd5ec75ecd3697e37782c9dd53998c889d5b9ef4d (diff)
downloadtrackermap-server-eb1373894ae52054403625ef1261f3399272f5a7.tar.gz
trackermap-server-eb1373894ae52054403625ef1261f3399272f5a7.tar.bz2
trackermap-server-eb1373894ae52054403625ef1261f3399272f5a7.zip
Merge pull request #2617 from Abyss777/get_single_position
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())