]> git.mxchange.org Git - juser-login-core.git/blobdiff - src/org/mxchange/jusercore/model/user/LoginUser.java
ignored create-persistence-unit warning as no persistence.xml shall be created here...
[juser-login-core.git] / src / org / mxchange / jusercore / model / user / LoginUser.java
index 3264b5b9171f0307f2acf04d3ab0254078571e83..33678e58aa60c177238ad1e8ca4c35da2633cbfc 100644 (file)
@@ -66,15 +66,16 @@ import org.mxchange.jusercore.model.user.status.UserAccountStatus;
                {
                        @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 INNER JOIN users AS u ON u.userContact = c ORDER BY c.contactId ASC"),
-                       @NamedQuery (name = "SearchUser", query = "SELECT u FROM users AS u WHERE u = :param"),
                        @NamedQuery (name = "SearchUserName", query = "SELECT u FROM users AS u WHERE LOWER(u.userName) LIKE LOWER(:param)"),
                        @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 {
 
        /**
@@ -172,8 +173,11 @@ 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());