]> git.mxchange.org Git - juser-activity-core.git/commitdiff
Some rewrites:
authorRoland Häder <roland@mxchange.org>
Fri, 13 May 2016 13:14:27 +0000 (15:14 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 13 May 2016 13:14:27 +0000 (15:14 +0200)
- unique can be done at the property/field, maybe better there?
- userName + confirmKey can be longer now

src/org/mxchange/jusercore/model/user/LoginUser.java

index 9fb464fe6930edcc0ce4c7b3b5876fa2f4b43844..32adf8d00055daa0bb186f5bac82231ed7ee5fe8 100644 (file)
@@ -27,7 +27,6 @@ import javax.persistence.Enumerated;
 import javax.persistence.GeneratedValue;
 import javax.persistence.GenerationType;
 import javax.persistence.Id;
-import javax.persistence.Index;
 import javax.persistence.JoinColumn;
 import javax.persistence.Lob;
 import javax.persistence.NamedQueries;
@@ -48,19 +47,7 @@ import org.mxchange.jusercore.model.user.status.UserAccountStatus;
  */
 @Entity (name = "users")
 @Table (
-               name = "users",
-               indexes = {
-                       @Index (
-                                       name = "confirmation_key",
-                                       unique = true,
-                                       columnList = "user_confirm_key"
-                       ),
-                       @Index (
-                                       name = "user_name",
-                                       unique = true,
-                                       columnList = "user_name"
-                       )
-               }
+               name = "users"
 )
 @NamedQueries (
                {
@@ -95,7 +82,7 @@ public class LoginUser implements User {
        /**
         * Confirmation key
         */
-       @Column (name = "user_confirm_key", length = 50)
+       @Column (name = "user_confirm_key", unique = true)
        private String userConfirmKey;
 
        /**
@@ -146,7 +133,7 @@ public class LoginUser implements User {
         * User name
         */
        @Basic (optional = false)
-       @Column (name = "user_name", nullable = false, length = 20)
+       @Column (name = "user_name", nullable = false, length = 30, unique = true)
        private String userName;
 
        /**