summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-BE-common/src/main/java/org
diff options
context:
space:
mode:
authorDominik Mizyn <d.mizyn@samsung.com>2019-06-18 10:46:13 +0200
committerDominik Mizyn <d.mizyn@samsung.com>2019-06-18 10:46:17 +0200
commit78d887081e8a637ae116948029f37c0760392b7e (patch)
tree944ece08a4afa26cef327651429c64da19c65b2b /ecomp-portal-BE-common/src/main/java/org
parenta8d8fd9d5c8dbfa166c85d2a97184dea9cbcff69 (diff)
PortalAdmin class DB constraints
Java Bean Validation SR 380 annotations added to classes Getter/Setter changed into lombok annotation Issue-ID: PORTAL-641 Change-Id: I98909f4a82372f110aa42452476fb85c9bccbf3a Signed-off-by: Dominik Mizyn <d.mizyn@samsung.com>
Diffstat (limited to 'ecomp-portal-BE-common/src/main/java/org')
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/PortalAdmin.java46
1 files changed, 14 insertions, 32 deletions
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/PortalAdmin.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/PortalAdmin.java
index d923df8c..62e768db 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/PortalAdmin.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/PortalAdmin.java
@@ -45,59 +45,41 @@ import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.Size;
+import lombok.Getter;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
/**
* This is to handle portal admins
*/
@Entity
@Table(name = "fn_user")
+@Getter
+@Setter
public class PortalAdmin implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "user_id")
+ @Digits(integer = 11, fraction = 0)
public Long userId;
@Column(name = "login_id")
+ @Size(max = 25)
+ @SafeHtml
public String loginId;
@Column(name = "first_name")
+ @Size(max = 50)
+ @SafeHtml
public String firstName;
@Column(name = "last_name")
+ @Size(max = 50)
+ @SafeHtml
public String lastName;
- public Long getUserId() {
- return userId;
- }
-
- public void setUserId(Long userId) {
- this.userId = userId;
- }
-
- public String getLoginId() {
- return loginId;
- }
-
- public void setLoginId(String loginId) {
- this.loginId = loginId;
- }
-
- public String getFirstName() {
- return firstName;
- }
-
- public void setFirstName(String firstName) {
- this.firstName = firstName;
- }
-
- public String getLastName() {
- return lastName;
- }
-
- public void setLastName(String lastName) {
- this.lastName = lastName;
- }
-
}