aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/model
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-07-31 14:08:36 +0500
committerAbyss777 <abyss@fox5.ru>2017-07-31 15:17:59 +0500
commitae76cbf971bfc9e47ef21e87606dacc7c0e3ddc6 (patch)
treead0679fac893b5000f1abfaeee9f4433b3596374 /src/org/traccar/model
parentd3021c9ae11b177fe05b79e98f1e560e8c3cbaf5 (diff)
downloadtrackermap-server-ae76cbf971bfc9e47ef21e87606dacc7c0e3ddc6.tar.gz
trackermap-server-ae76cbf971bfc9e47ef21e87606dacc7c0e3ddc6.tar.bz2
trackermap-server-ae76cbf971bfc9e47ef21e87606dacc7c0e3ddc6.zip
Implement SQL requests construction
Diffstat (limited to 'src/org/traccar/model')
-rw-r--r--src/org/traccar/model/Device.java7
-rw-r--r--src/org/traccar/model/Position.java9
-rw-r--r--src/org/traccar/model/Server.java2
-rw-r--r--src/org/traccar/model/User.java6
4 files changed, 24 insertions, 0 deletions
diff --git a/src/org/traccar/model/Device.java b/src/org/traccar/model/Device.java
index 6a13c2b77..cd5dd12c4 100644
--- a/src/org/traccar/model/Device.java
+++ b/src/org/traccar/model/Device.java
@@ -18,6 +18,9 @@ package org.traccar.model;
import java.util.Date;
import java.util.List;
+import org.traccar.database.QueryAdditional;
+import org.traccar.database.QueryIgnore;
+
public class Device extends ExtendedModel {
private String name;
@@ -46,6 +49,7 @@ public class Device extends ExtendedModel {
private String status;
+ @QueryIgnore
public String getStatus() {
return status != null ? status : STATUS_OFFLINE;
}
@@ -56,6 +60,7 @@ public class Device extends ExtendedModel {
private Date lastUpdate;
+ @QueryAdditional
public Date getLastUpdate() {
if (lastUpdate != null) {
return new Date(lastUpdate.getTime());
@@ -74,6 +79,7 @@ public class Device extends ExtendedModel {
private long positionId;
+ @QueryIgnore
public long getPositionId() {
return positionId;
}
@@ -94,6 +100,7 @@ public class Device extends ExtendedModel {
private List<Long> geofenceIds;
+ @QueryIgnore
public List<Long> getGeofenceIds() {
return geofenceIds;
}
diff --git a/src/org/traccar/model/Position.java b/src/org/traccar/model/Position.java
index 4412b012c..66a6f91ce 100644
--- a/src/org/traccar/model/Position.java
+++ b/src/org/traccar/model/Position.java
@@ -17,6 +17,8 @@ package org.traccar.model;
import java.util.Date;
+import org.traccar.database.QueryIgnore;
+
public class Position extends Message {
public static final String KEY_ORIGINAL = "raw";
@@ -196,6 +198,7 @@ public class Position extends Message {
private boolean outdated;
+ @QueryIgnore
public boolean getOutdated() {
return outdated;
}
@@ -294,4 +297,10 @@ public class Position extends Message {
this.network = network;
}
+ @Override
+ @QueryIgnore
+ public String getType() {
+ return super.getType();
+ }
+
}
diff --git a/src/org/traccar/model/Server.java b/src/org/traccar/model/Server.java
index cd5b0624e..246be0b4f 100644
--- a/src/org/traccar/model/Server.java
+++ b/src/org/traccar/model/Server.java
@@ -17,10 +17,12 @@ package org.traccar.model;
import java.util.TimeZone;
+import org.traccar.database.QueryIgnore;
import org.traccar.helper.Log;
public class Server extends ExtendedModel {
+ @QueryIgnore
public String getVersion() {
return Log.getAppVersion();
}
diff --git a/src/org/traccar/model/User.java b/src/org/traccar/model/User.java
index 6e6a079c2..72b53ee5d 100644
--- a/src/org/traccar/model/User.java
+++ b/src/org/traccar/model/User.java
@@ -16,6 +16,9 @@
package org.traccar.model;
import com.fasterxml.jackson.annotation.JsonIgnore;
+
+import org.traccar.database.QueryAdditional;
+import org.traccar.database.QueryIgnore;
import org.traccar.helper.Hashing;
import java.util.Date;
@@ -228,6 +231,7 @@ public class User extends ExtendedModel {
}
}
+ @QueryIgnore
public String getPassword() {
return null;
}
@@ -243,6 +247,7 @@ public class User extends ExtendedModel {
private String hashedPassword;
@JsonIgnore
+ @QueryAdditional
public String getHashedPassword() {
return hashedPassword;
}
@@ -254,6 +259,7 @@ public class User extends ExtendedModel {
private String salt;
@JsonIgnore
+ @QueryAdditional
public String getSalt() {
return salt;
}