From 2633479a5658e8fea1d220eaeaa87509152ee95d Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Fri, 9 Oct 2015 12:30:48 +0200 Subject: [PATCH] =?utf8?q?Sorted=20members=20Signed-off-by:Roland=20H?= =?utf8?q?=C3=A4der=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../jusercore/model/user/LoginUser.java | 80 +++++++++---------- .../mxchange/jusercore/model/user/User.java | 56 ++++++------- 2 files changed, 68 insertions(+), 68 deletions(-) diff --git a/src/org/mxchange/jusercore/model/user/LoginUser.java b/src/org/mxchange/jusercore/model/user/LoginUser.java index 8284842..19ab30a 100644 --- a/src/org/mxchange/jusercore/model/user/LoginUser.java +++ b/src/org/mxchange/jusercore/model/user/LoginUser.java @@ -44,13 +44,13 @@ import org.mxchange.jusercore.model.user.status.UserAccountStatus; */ @Entity (name = "users") @Table (name = "users") -@NamedQueries( - { - @NamedQuery(name = "AllUserNames", query = "SELECT DISTINCT u.userName FROM users AS u ORDER BY u.userId ASC"), - @NamedQuery(name = "AllEmailAddresses", query = "SELECT DISTINCT c.emailAddress FROM contacts AS c ORDER BY c.contactId ASC"), - @NamedQuery(name = "SearchUserName", query = "SELECT u FROM users AS u WHERE LOWER(u.userName) LIKE LOWER(:param)"), - @NamedQuery(name = "SearchEmailAddress", query = "SELECT u FROM users AS u INNER JOIN contacts AS c ON u.userContact = c WHERE LOWER(c.emailAddress) LIKE LOWER(:param)") - } +@NamedQueries ( + { + @NamedQuery (name = "AllUserNames", query = "SELECT DISTINCT u.userName FROM users AS u ORDER BY u.userId ASC"), + @NamedQuery (name = "AllEmailAddresses", query = "SELECT DISTINCT c.emailAddress FROM contacts AS c ORDER BY c.contactId ASC"), + @NamedQuery (name = "SearchUserName", query = "SELECT u FROM users AS u WHERE LOWER(u.userName) LIKE LOWER(:param)"), + @NamedQuery (name = "SearchEmailAddress", query = "SELECT u FROM users AS u INNER JOIN contacts AS c ON u.userContact = c WHERE LOWER(c.emailAddress) LIKE LOWER(:param)") + } ) public class LoginUser implements User { @@ -59,13 +59,6 @@ public class LoginUser implements User { */ private static final long serialVersionUID = 4_328_454_581_751L; - /** - * Id number from "contacts" table - */ - @JoinColumn (name = "contact_id", nullable = false, updatable = false) - @OneToOne (cascade = CascadeType.ALL, targetEntity = UserContact.class, optional = false) - private Contact userContact; - /** * Account status */ @@ -80,6 +73,13 @@ public class LoginUser implements User { @Column (name = "user_confirm_key", length = 50) private String userConfirmKey; + /** + * Id number from "contacts" table + */ + @JoinColumn (name = "contact_id", nullable = false, updatable = false) + @OneToOne (cascade = CascadeType.ALL, targetEntity = UserContact.class, optional = false) + private Contact userContact; + /** * "created" timestamp */ @@ -88,6 +88,12 @@ public class LoginUser implements User { @Column (name = "user_created", nullable = false) private Calendar userCreated; + /** + * Encrypted password + */ + @Column (name = "user_encrypted_password", nullable = false) + private String userEncryptedPassword; + /** * User id */ @@ -109,12 +115,6 @@ public class LoginUser implements User { @Column (name = "user_name", nullable = false, length = 20) private String userName; - /** - * Encrypted password - */ - @Column (name = "user_encrypted_password", nullable = false) - private String userEncryptedPassword; - /** * Default constructor */ @@ -135,16 +135,6 @@ public class LoginUser implements User { this.setUserLocked(user.getUserLocked()); } - @Override - public Contact getUserContact () { - return this.userContact; - } - - @Override - public void setUserContact (final Contact userContact) { - this.userContact = userContact; - } - @Override public UserAccountStatus getUserAccountStatus () { return this.userAccountStatus; @@ -165,6 +155,16 @@ public class LoginUser implements User { this.userConfirmKey = customerConfirmKey; } + @Override + public Contact getUserContact () { + return this.userContact; + } + + @Override + public void setUserContact (final Contact userContact) { + this.userContact = userContact; + } + @Override public Calendar getUserCreated () { return this.userCreated; @@ -175,6 +175,16 @@ public class LoginUser implements User { this.userCreated = userCreated; } + @Override + public String getUserEncryptedPassword () { + return this.userEncryptedPassword; + } + + @Override + public void setUserEncryptedPassword (final String userEncryptedPassword) { + this.userEncryptedPassword = userEncryptedPassword; + } + @Override public Long getUserId () { return this.userId; @@ -204,14 +214,4 @@ public class LoginUser implements User { public void setUserName (final String userName) { this.userName = userName; } - - @Override - public String getUserEncryptedPassword () { - return this.userEncryptedPassword; - } - - @Override - public void setUserEncryptedPassword (final String userEncryptedPassword) { - this.userEncryptedPassword = userEncryptedPassword; - } } diff --git a/src/org/mxchange/jusercore/model/user/User.java b/src/org/mxchange/jusercore/model/user/User.java index 7513d3a..51de650 100644 --- a/src/org/mxchange/jusercore/model/user/User.java +++ b/src/org/mxchange/jusercore/model/user/User.java @@ -35,20 +35,6 @@ public interface User extends Serializable { */ public void copyAll (final User customer); - /** - * Getter for contact instance - *

- * @return Contact id number - */ - public Contact getUserContact (); - - /** - * Setter for contact instance - *

- * @param contact Contact instance - */ - public void setUserContact (final Contact contact); - /** * Getter for account status *

@@ -77,6 +63,20 @@ public interface User extends Serializable { */ public void setUserConfirmKey (final String customerConfirmKey); + /** + * Getter for contact instance + *

+ * @return Contact id number + */ + public Contact getUserContact (); + + /** + * Setter for contact instance + *

+ * @param contact Contact instance + */ + public void setUserContact (final Contact contact); + /** * Getter for "created" timestamp *

@@ -91,6 +91,20 @@ public interface User extends Serializable { */ public void setUserCreated (final Calendar customerCreated); + /** + * Getter for encrypted password + *

+ * @return Encrypted password + */ + public String getUserEncryptedPassword (); + + /** + * Setter for password hash + *

+ * @param userEncryptedPassword Encrypted password + */ + public void setUserEncryptedPassword (final String userEncryptedPassword); + /** * Getter for customer id number *

@@ -132,18 +146,4 @@ public interface User extends Serializable { * @param customerNumber User number */ public void setUserName (final String customerNumber); - - /** - * Getter for encrypted password - *

- * @return Encrypted password - */ - public String getUserEncryptedPassword (); - - /** - * Setter for password hash - *

- * @param userEncryptedPassword Encrypted password - */ - public void setUserEncryptedPassword (final String userEncryptedPassword); } -- 2.39.5