aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database/DataManager.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-09-21 16:27:55 +0500
committerAbyss777 <abyss@fox5.ru>2016-09-21 16:27:55 +0500
commitbaad910016f2f17e6bf89f9d5db17349c4a9a62a (patch)
tree559c919ea736013ff758d5145082bf9fa65751ac /src/org/traccar/database/DataManager.java
parent9ee812366367148387f289b9977fd809e6a56786 (diff)
downloadtrackermap-server-baad910016f2f17e6bf89f9d5db17349c4a9a62a.tar.gz
trackermap-server-baad910016f2f17e6bf89f9d5db17349c4a9a62a.tar.bz2
trackermap-server-baad910016f2f17e6bf89f9d5db17349c4a9a62a.zip
Add attributes aliases
Diffstat (limited to 'src/org/traccar/database/DataManager.java')
-rw-r--r--src/org/traccar/database/DataManager.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java
index abc48f063..02adb0455 100644
--- a/src/org/traccar/database/DataManager.java
+++ b/src/org/traccar/database/DataManager.java
@@ -37,6 +37,7 @@ import liquibase.resource.ResourceAccessor;
import org.traccar.Config;
import org.traccar.helper.Log;
+import org.traccar.model.AttributeAlias;
import org.traccar.model.Device;
import org.traccar.model.DevicePermission;
import org.traccar.model.Event;
@@ -460,4 +461,27 @@ public class DataManager {
.setLong("id", notification.getId())
.executeUpdate();
}
+
+ public Collection<AttributeAlias> getAttributeAliases() throws SQLException {
+ return QueryBuilder.create(dataSource, getQuery("database.selectAttributeAliases"))
+ .executeQuery(AttributeAlias.class);
+ }
+
+ public void addAttributeAlias(AttributeAlias attributeAlias) throws SQLException {
+ attributeAlias.setId(QueryBuilder.create(dataSource, getQuery("database.insertAttributeAlias"), true)
+ .setObject(attributeAlias)
+ .executeUpdate());
+ }
+
+ public void updateAttributeAlias(AttributeAlias attributeAlias) throws SQLException {
+ QueryBuilder.create(dataSource, getQuery("database.updateAttributeAlias"))
+ .setObject(attributeAlias)
+ .executeUpdate();
+ }
+
+ public void removeAttributeAlias(long attributeAliasId) throws SQLException {
+ QueryBuilder.create(dataSource, getQuery("database.deleteAttributeAlias"))
+ .setLong("id", attributeAliasId)
+ .executeUpdate();
+ }
}