@NamedQuery (name = "AllUserNames", query = "SELECT DISTINCT u.userName FROM users AS u ORDER BY u.userId ASC"),
@NamedQuery (name = "AllEmailAddresses", query = "SELECT DISTINCT c.contactEmailAddress 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.contactEmailAddress) 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.contactEmailAddress) LIKE LOWER(:param)"),
+ @NamedQuery (name = "AllPublicUsers", query = "SELECT u FROM users AS u WHERE u.userAccountStatus LIKE 'CONFIRMED' AND u.userPublicProfile = TRUE")
}
)
public class LoginUser implements User {
@Column (name = "user_name", nullable = false, length = 20)
private String userName;
+ /**
+ * Whether the user wants a public profile. This means that it can be viewed
+ * from the Internet by everyone (only profile, no personal data, this needs
+ * explicit agreement) and it can be found for sharing addresses with.
+ */
+ @Basic (optional = false)
+ @Column (name = "user_public_profile_flag", nullable = false)
+ private Boolean userPublicProfile;
+
/**
* Default constructor
*/
public LoginUser () {
+ // Default is not public
+ this.userPublicProfile = Boolean.FALSE;
}
@Override
this.userName = userName;
}
+ @Override
+ public Boolean getUserPublicProfile () {
+ return this.userPublicProfile;
+ }
+
+ @Override
+ public void setUserPublicProfile (final Boolean userPublicProfile) {
+ this.userPublicProfile = userPublicProfile;
+ }
+
@Override
public int hashCode () {
int hash = 5;
*/
public void setUserName (final String customerNumber);
+ /**
+ * Getter for public user profile flag
+ * <p>
+ * @return Whether the user has a public profile
+ */
+ public Boolean getUserPublicProfile ();
+
+ /**
+ * Setter for public user profile flag
+ * <p>
+ * @param userPublicProfile Whether the user has a public profile
+ */
+ public void setUserPublicProfile (final Boolean userPublicProfile);
+
/**
* Checks if object is a User instance and whether it matches with this
* object.