From 7f8973e0199a9deea042f802a956bab53a0190db Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Thu, 22 Oct 2015 10:06:00 +0200 Subject: [PATCH] =?utf8?q?added=20timestamp=20when=20the=20user=20has=20up?= =?utf8?q?dated=20profile=20Signed-off-by:Roland=20H=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../jusercore/model/user/LoginUser.java | 23 ++++++++++++++++--- .../mxchange/jusercore/model/user/User.java | 14 +++++++++++ 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/src/org/mxchange/jusercore/model/user/LoginUser.java b/src/org/mxchange/jusercore/model/user/LoginUser.java index b69c1db..71746d3 100644 --- a/src/org/mxchange/jusercore/model/user/LoginUser.java +++ b/src/org/mxchange/jusercore/model/user/LoginUser.java @@ -135,7 +135,7 @@ public class LoginUser implements User { * Last locked reason */ @Lob - @Column(name = "user_last_locked_reason") + @Column (name = "user_last_locked_reason") private String lastLockedReason; /** @@ -144,6 +144,13 @@ public class LoginUser implements User { @Column (name = "user_name", nullable = false, length = 20) private String userName; + /** + * When this user has been updated + */ + @Temporal (TemporalType.TIMESTAMP) + @Column (name = "user_updated") + private Calendar userUpdated; + /** * Profile mode of this user */ @@ -185,8 +192,8 @@ public class LoginUser implements User { final User other = (User) object; - return ((Objects.equals(this.getUserName(), other.getUserName())) && - (Objects.equals(this.getUserId(), other.getUserId()))); + return ((Objects.equals(this.getUserName(), other.getUserName())) + && (Objects.equals(this.getUserId(), other.getUserId()))); } @Override @@ -289,6 +296,16 @@ public class LoginUser implements User { this.userProfileMode = userProfileMode; } + @Override + public Calendar getUserUpdated () { + return this.userUpdated; + } + + @Override + public void setUserUpdated (final Calendar userUpdated) { + this.userUpdated = userUpdated; + } + @Override public int hashCode () { int hash = 5; diff --git a/src/org/mxchange/jusercore/model/user/User.java b/src/org/mxchange/jusercore/model/user/User.java index 04c7a37..993dc35 100644 --- a/src/org/mxchange/jusercore/model/user/User.java +++ b/src/org/mxchange/jusercore/model/user/User.java @@ -176,6 +176,20 @@ public interface User extends Serializable { */ void setUserProfileMode (final ProfileMode userPublicProfile); + /** + * Getter for updated timestamp + *

+ * @return Updated timestamp + */ + Calendar getUserUpdated (); + + /** + * Setter for updated timestamp + *

+ * @param userUpdated Updated timestamp + */ + void setUserUpdated (final Calendar userUpdated); + /** * Checks if object is a User instance and whether it matches with this * object. -- 2.39.5