From 78d887081e8a637ae116948029f37c0760392b7e Mon Sep 17 00:00:00 2001 From: Dominik Mizyn Date: Tue, 18 Jun 2019 10:46:13 +0200 Subject: 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 --- .../portalapp/portal/transport/PortalAdmin.java | 46 +++++++--------------- 1 file changed, 14 insertions(+), 32 deletions(-) (limited to 'ecomp-portal-BE-common') 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; - } - } -- cgit 1.2.3-korg