mysql-connector-java to mariadb-java-client change
[portal.git] / portal-BE / src / main / java / org / onap / portal / domain / db / fn / FnRole.java
index eda3fb2..edd843a 100644 (file)
@@ -40,6 +40,7 @@
 
 package org.onap.portal.domain.db.fn;
 
+import java.io.Serializable;
 import java.util.Set;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
@@ -52,13 +53,15 @@ import javax.persistence.Index;
 import javax.persistence.JoinColumn;
 import javax.persistence.JoinTable;
 import javax.persistence.ManyToMany;
+import javax.persistence.NamedNativeQueries;
+import javax.persistence.NamedNativeQuery;
 import javax.persistence.NamedQueries;
 import javax.persistence.NamedQuery;
 import javax.persistence.OneToMany;
 import javax.persistence.Table;
+import javax.persistence.UniqueConstraint;
 import javax.validation.constraints.Digits;
 import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Pattern;
 import javax.validation.constraints.Size;
 import lombok.AllArgsConstructor;
 import lombok.Getter;
@@ -69,6 +72,7 @@ import org.onap.portal.domain.db.ep.EpAppRoleFunction;
 import org.onap.portal.domain.db.ep.EpRoleNotification;
 import org.onap.portal.domain.db.ep.EpUserRolesRequestDet;
 import org.onap.portal.domain.db.ep.EpWidgetCatalogRole;
+import org.onap.portal.domain.dto.DomainVo;
 
 /*
 CREATE TABLE `fn_role` (
@@ -98,7 +102,7 @@ CREATE TABLE `fn_role` (
                 query = "FROM FnRole where role_id =:roleId and app_id is null"),
         @NamedQuery(
                 name = "FnRole.retrieveAppRoleByAppRoleIdAndByAppId",
-                query = "FROM FnRole where app_role_id =:appRoleId and app_id =:appId"),
+                query = "FROM FnRole where appRoleId =:appRoleId and appId =:appId"),
         @NamedQuery(
                 name = "FnRole.retrieveAppRoleByRoleIdAndAppId",
                 query = "FROM FnRole where role_id =:roleId and app_id =:appId"),
@@ -120,7 +124,7 @@ CREATE TABLE `fn_role` (
 @Getter
 @Setter
 @Entity
-public class FnRole {
+public class FnRole extends DomainVo implements Serializable {
 
        @Id
        @GeneratedValue(strategy = GenerationType.AUTO)
@@ -133,11 +137,8 @@ public class FnRole {
        @SafeHtml
        private String roleName;
        @Column(name = "active_yn", length = 1, columnDefinition = "character varying(1) default 'y'", nullable = false)
-       @Pattern(regexp = "[YNyn]")
-       @Size(max = 1)
        @NotNull
-       @SafeHtml
-       private String activeYn;
+       private Boolean activeYn;
        @Column(name = "priority", length = 4, columnDefinition = "decimal(4,0) DEFAULT NULL")
        @Digits(integer = 4, fraction = 0)
        private Long priority;