*/
@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 {
*/
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
*/
@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
*/
@Column (name = "user_created", nullable = false)
private Calendar userCreated;
+ /**
+ * Encrypted password
+ */
+ @Column (name = "user_encrypted_password", nullable = false)
+ private String userEncryptedPassword;
+
/**
* User id
*/
@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
*/
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;
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;
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;
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;
- }
}
*/
public void copyAll (final User customer);
- /**
- * Getter for contact instance
- * <p>
- * @return Contact id number
- */
- public Contact getUserContact ();
-
- /**
- * Setter for contact instance
- * <p>
- * @param contact Contact instance
- */
- public void setUserContact (final Contact contact);
-
/**
* Getter for account status
* <p>
*/
public void setUserConfirmKey (final String customerConfirmKey);
+ /**
+ * Getter for contact instance
+ * <p>
+ * @return Contact id number
+ */
+ public Contact getUserContact ();
+
+ /**
+ * Setter for contact instance
+ * <p>
+ * @param contact Contact instance
+ */
+ public void setUserContact (final Contact contact);
+
/**
* Getter for "created" timestamp
* <p>
*/
public void setUserCreated (final Calendar customerCreated);
+ /**
+ * Getter for encrypted password
+ * <p>
+ * @return Encrypted password
+ */
+ public String getUserEncryptedPassword ();
+
+ /**
+ * Setter for password hash
+ * <p>
+ * @param userEncryptedPassword Encrypted password
+ */
+ public void setUserEncryptedPassword (final String userEncryptedPassword);
+
/**
* Getter for customer id number
* <p>
* @param customerNumber User number
*/
public void setUserName (final String customerNumber);
-
- /**
- * Getter for encrypted password
- * <p>
- * @return Encrypted password
- */
- public String getUserEncryptedPassword ();
-
- /**
- * Setter for password hash
- * <p>
- * @param userEncryptedPassword Encrypted password
- */
- public void setUserEncryptedPassword (final String userEncryptedPassword);
}