aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/web/shared/model
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/web/shared/model')
-rw-r--r--src/org/traccar/web/shared/model/Device.java8
-rw-r--r--src/org/traccar/web/shared/model/Position.java28
2 files changed, 22 insertions, 14 deletions
diff --git a/src/org/traccar/web/shared/model/Device.java b/src/org/traccar/web/shared/model/Device.java
index df4afb4b..d638046e 100644
--- a/src/org/traccar/web/shared/model/Device.java
+++ b/src/org/traccar/web/shared/model/Device.java
@@ -21,6 +21,7 @@ import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
+import javax.persistence.OneToOne;
import javax.persistence.Table;
@Entity
@@ -46,6 +47,13 @@ public class Device implements Serializable {
return id;
}
+ @OneToOne
+ private Position latestPosition;
+
+ public Position getLatestPosition() {
+ return latestPosition;
+ }
+
@Column(unique = true)
private String uniqueId;
diff --git a/src/org/traccar/web/shared/model/Position.java b/src/org/traccar/web/shared/model/Position.java
index 581c94c4..d5fa9a91 100644
--- a/src/org/traccar/web/shared/model/Position.java
+++ b/src/org/traccar/web/shared/model/Position.java
@@ -75,45 +75,45 @@ public class Position implements Serializable, Cloneable {
return time;
}
- private boolean valid;
+ private Boolean valid;
- public boolean getValid() {
+ public Boolean getValid() {
return valid;
}
- private double latitude;
+ private Double latitude;
- public double getLatitude() {
+ public Double getLatitude() {
return latitude;
}
- private double longitude;
+ private Double longitude;
- public double getLongitude() {
+ public Double getLongitude() {
return longitude;
}
- private double altitude;
+ private Double altitude;
- public double getAltitude() {
+ public Double getAltitude() {
return altitude;
}
- private double speed;
+ private Double speed;
- public double getSpeed() {
+ public Double getSpeed() {
return speed;
}
- private double course;
+ private Double course;
- public double getCourse() {
+ public Double getCourse() {
return course;
}
- private double power;
+ private Double power;
- public double getPower() {
+ public Double getPower() {
return power;
}