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;
@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)
@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
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);
+ }
}