From f1af55094e2221d84dde50b2e7b91eda76a721ee Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 13 May 2016 15:14:27 +0200 Subject: [PATCH] Some rewrites: - unique can be done at the property/field, maybe better there? - userName + confirmKey can be longer now --- .../jusercore/model/user/LoginUser.java | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/src/org/mxchange/jusercore/model/user/LoginUser.java b/src/org/mxchange/jusercore/model/user/LoginUser.java index 9fb464f..32adf8d 100644 --- a/src/org/mxchange/jusercore/model/user/LoginUser.java +++ b/src/org/mxchange/jusercore/model/user/LoginUser.java @@ -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; /** -- 2.39.5