diff options
Diffstat (limited to 'src/org/traccar/web/shared')
-rw-r--r-- | src/org/traccar/web/shared/model/Device.java | 7 | ||||
-rw-r--r-- | src/org/traccar/web/shared/model/User.java | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/org/traccar/web/shared/model/Device.java b/src/org/traccar/web/shared/model/Device.java index 324bad83..6f6d6c57 100644 --- a/src/org/traccar/web/shared/model/Device.java +++ b/src/org/traccar/web/shared/model/Device.java @@ -17,7 +17,6 @@ package org.traccar.web.shared.model; import java.io.Serializable; -import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; @@ -49,9 +48,13 @@ public class Device implements Serializable { return id; } - @OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL) + @OneToOne(fetch = FetchType.EAGER) private Position latestPosition; + public void setLatestPosition(Position latestPosition) { + this.latestPosition = latestPosition; + } + public Position getLatestPosition() { return latestPosition; } diff --git a/src/org/traccar/web/shared/model/User.java b/src/org/traccar/web/shared/model/User.java index ab11da4e..20adc12a 100644 --- a/src/org/traccar/web/shared/model/User.java +++ b/src/org/traccar/web/shared/model/User.java @@ -38,6 +38,7 @@ public class User implements Serializable, Cloneable { private static final long serialVersionUID = 1; public User() { + admin = false; } public User(User user) { @@ -89,7 +90,7 @@ public class User implements Serializable, Cloneable { } @GwtTransient - @OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL) + @OneToMany(fetch = FetchType.EAGER) private List<Device> devices = new LinkedList<Device>(); public void setDevices(List<Device> devices) { |