WidgetsCatalogControllerTest up
[portal.git] / portal-BE / src / main / java / org / onap / portal / domain / db / fn / FnApp.java
index 79cc632..399cb55 100644 (file)
@@ -41,8 +41,7 @@
 package org.onap.portal.domain.db.fn;
 
 import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.Set;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Embeddable;
@@ -120,7 +119,7 @@ public class FnApp extends DomainVo implements Serializable {
 
        @Id
        @GeneratedValue(strategy = GenerationType.AUTO)
-       @Column(name = "app_Id", length = 11, nullable = false, columnDefinition = "int(11) AUTO_INCREMENT")
+       @Column(name = "app_Id", length = 11, nullable = false)
        @Digits(integer = 11, fraction = 0)
        private Long appId;
        @Column(name = "app_name", length = 100, nullable = false, columnDefinition = "varchar(100) not null default '?'")
@@ -173,17 +172,9 @@ public class FnApp extends DomainVo implements Serializable {
        @NotNull
        private String appPassword;
        @Column(name = "open", length = 1, columnDefinition = "char(1) default 'N'")
-       @Pattern(regexp = "[YNyn]")
-       @Size(max = 1)
-       @NotNull
-       @SafeHtml
-       private String open;
+       private Boolean open;
        @Column(name = "ENABLED", length = 1, columnDefinition = "char(1) default 'N'")
-       @Pattern(regexp = "[YNyn]")
-       @Size(max = 1)
-       @NotNull
-       @SafeHtml
-       private String enabled;
+       private Boolean enabled;
        @Column(name = "active_yn", length = 1, columnDefinition = "char(1) default 'Y'")
        @Pattern(regexp = "[YNyn]")
        @Size(max = 1)
@@ -212,11 +203,7 @@ public class FnApp extends DomainVo implements Serializable {
        @Digits(integer = 11, fraction = 0)
        private Long appType;
        @Column(name = "auth_central", length = 1, columnDefinition = "char(1) not null default 'N'", nullable = false)
-       @Pattern(regexp = "[YNyn]")
-       @Size(max = 1)
-       @NotNull
-       @SafeHtml
-       private String authCentral;
+       private Boolean authCentral;
        @Column(name = "auth_namespace", length = 100)
        @Size(max = 100)
        @SafeHtml
@@ -227,61 +214,65 @@ public class FnApp extends DomainVo implements Serializable {
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<FnMenuFunctionalRoles> fnMenuFunctionalRoles = new ArrayList<>();
+       private Set<FnMenuFunctionalRoles> fnMenuFunctionalRoles;
        @OneToMany(
                targetEntity = EpUserRolesRequest.class,
                mappedBy = "appId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<EpUserRolesRequest> epUserRolesRequests = new ArrayList<>();
+       private Set<EpUserRolesRequest> epUserRolesRequests;
        @OneToMany(
                targetEntity = EpAppFunction.class,
                mappedBy = "appId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<EpAppFunction> epAppFunctions = new ArrayList<>();
+       private Set<EpAppFunction> epAppFunctions;
        @OneToMany(
                targetEntity = EpAppRoleFunction.class,
                mappedBy = "appId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<EpAppRoleFunction> epAppRoleFunctions = new ArrayList<>();
+       private Set<EpAppRoleFunction> epAppRoleFunctions;
        @OneToMany(
                targetEntity = FnUserRole.class,
                mappedBy = "appId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<FnUserRole> fnUserRoles = new ArrayList<>();
+       private Set<FnUserRole> fnUserRoles;
        @OneToMany(
                targetEntity = EpWebAnalyticsSource.class,
                mappedBy = "appId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<EpWebAnalyticsSource> epWebAnalyticsSources = new ArrayList<>();
+       private Set<EpWebAnalyticsSource> epWebAnalyticsSources;
        @OneToMany(
                targetEntity = EpWidgetCatalogRole.class,
                mappedBy = "appId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<EpWidgetCatalogRole> epWidgetCatalogRoles = new ArrayList<>();
+       private Set<EpWidgetCatalogRole> epWidgetCatalogRoles;
        @OneToMany(
                targetEntity = EpMicroservice.class,
                mappedBy = "appId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<EpMicroservice> epMicroservices = new ArrayList<>();
+       private Set<EpMicroservice> epMicroservices;
        @OneToMany(
                targetEntity = FnPersUserAppSel.class,
                mappedBy = "appId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<FnPersUserAppSel> fnPersUserAppSels = new ArrayList<>();
+       private Set<FnPersUserAppSel> fnPersUserAppSels;
+
+       public Boolean isRestrictedApp() {
+              return (this.appType == 2);
+       }
 }