@NamedQuery (name = "SearchUserId", query = "SELECT u FROM users AS u WHERE u.userId = :id"),
@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 = "SearchAllUsersExcept", query = "SELECT u FROM users AS u WHERE u != :user ORDER BY u.userId ASC"),
+ @NamedQuery (name = "AllUsers", query = "SELECT u FROM users AS u ORDER BY u.userId ASC"),
@NamedQuery (name = "AllPublicUsers", query = "SELECT u FROM users AS u WHERE u.userAccountStatus = :status AND u.userProfileMode = :mode ORDER BY u.userId ASC"),
@NamedQuery (name = "AllMemberPublicUsers", query = "SELECT u FROM users AS u WHERE u.userAccountStatus = :status AND u.userProfileMode IN (:public, :members) ORDER BY u.userId ASC")
}
)
+@SuppressWarnings ("PersistenceUnitPresent")
public class LoginUser implements User {
/**
@Override
public void copyAll (final User user) {
- // Copy also contact data
- this.getUserContact().copyAll(user.getUserContact());
+ // Is contact set?
+ if (user.getUserContact() instanceof Contact) {
+ // Copy also contact data
+ this.getUserContact().copyAll(user.getUserContact());
+ }
// Copy other data
this.setUserConfirmKey(user.getUserConfirmKey());