Merge "Reduce number of parameters in constructor"
authorManoop Talasila <talasila@research.att.com>
Mon, 19 Aug 2019 14:49:22 +0000 (14:49 +0000)
committerGerrit Code Review <gerrit@onap.org>
Mon, 19 Aug 2019 14:49:22 +0000 (14:49 +0000)
105 files changed:
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/CentralV2RoleFunction.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/domain/ExternalRoleDetails.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CentralRoleFunction.java
ecomp-portal-BE-common/src/main/java/org/onap/portalapp/portal/transport/CentralV2UserApp.java
portal-BE/pom.xml
portal-BE/src/main/java/org/onap/portal/domain/db/SchemaInfo.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/VUrlAccess.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrFavoriteReports.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrFilehistLog.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrFolder.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrFolderAccess.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrLuFileType.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrRaptorActionImg.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrRaptorPdfImg.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrRemoteSchemaInfo.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrReport.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrReportAccess.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrReportDwnldLog.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrReportEmailSentLog.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrReportFileHistory.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrReportLog.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrReportSchedule.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrReportScheduleUsers.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrReportTemplateMap.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrScheduleActivityLog.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrTableJoin.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrTableRole.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrTableSource.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpAppFunction.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpAppRoleFunction.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpBasicAuthAccount.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpEndpoints.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpEndpointsBasicAuthAccount.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpMicroservice.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpMicroserviceParameter.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpMlModel.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpMlRec.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpMlUser.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpNotification.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpPersUserAppSort.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpPersUserWidgetPlacement.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpPersUserWidgetSel.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpRoleNotification.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpUserNotification.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpUserRolesRequest.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpUserRolesRequestDet.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpWebAnalyticsSource.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpWidgetCatalog.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpWidgetCatalogFiles.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpWidgetCatalogParameter.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpWidgetCatalogRole.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpWidgetPreviewFiles.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnApp.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnAppContactUs.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnAuditAction.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnAuditActionLog.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnAuditLog.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnBroadcastMessage.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnChatLogs.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnChatRoom.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnChatUsers.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnCommonWidgetData.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnDatasource.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnDisplayText.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnFunction.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLanguage.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLuActivity.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLuAlertMethod.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLuBroadcastSite.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLuMenuSet.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLuPriority.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLuRoleType.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLuTabSet.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLuTimezone.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnMenu.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnMenuFunctional.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnMenuFunctionalAncestors.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnMenuFunctionalRoles.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnOrg.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnPersUserAppSel.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzBlobTriggers.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzCalendars.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzCronTriggers.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzFiredTriggers.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzJobDetails.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzLocks.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzPausedTriggerGrps.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzSchedulerState.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzSimpleTriggers.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzSimpropTriggers.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzTriggers.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnRestrictedUrl.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnRole.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnRoleFunction.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnRoleV.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnScheduleWorkflows.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnSharedContext.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnTab.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnTabSelected.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnUser.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnUserRole.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnWorkflow.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/fn/compositePK/FnQzTriggersId.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/dto/DomainVo.java [new file with mode: 0644]
portal-BE/src/main/resources/application.properties

index a761103..be56579 100644 (file)
@@ -186,8 +186,32 @@ public class CentralV2RoleFunction extends DomainVo implements Serializable, Com
         String c2 = ((CentralV2RoleFunction)obj).getName();
 
         return (c1 == null || c2 == null) ? 1 : c1.compareTo(c2);
-      }
-       
-       
-   
+    }
+
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((name == null) ? 0 : name.hashCode());
+        return result;
+    }
+
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (!super.equals(obj))
+            return false;
+        if (getClass() != obj.getClass())
+            return false;
+        CentralV2RoleFunction other = (CentralV2RoleFunction) obj;
+        if (name == null) {
+            if (other.name != null)
+                return false;
+        } else if (!name.equals(other.name))
+            return false;
+        return true;
+    }
 }
index bb90278..34b2c50 100644 (file)
@@ -47,18 +47,16 @@ import lombok.Setter;
 @EqualsAndHashCode
 public class ExternalRoleDetails implements Comparable {
 
-       private String  name;
+    private String name;
     private boolean active;
     private Integer priority;
-    private Long appId;     // used by ONAP only 
+    private Long appId; // used by ONAP only
     private Long appRoleId; // used by ONAP only
-       private List<EPAppRoleFunction> perms;
-
-       @Override
-       public int compareTo(Object obj) {
-               EPRole other = (EPRole)obj;
-               return (this.getName() == null || other.getName() == null) ? 1 : getName().equals(other.getName()) ? 0 : 1;
-       }
-
+    private List<EPAppRoleFunction> perms;
 
+    @Override
+    public int compareTo(Object obj) {
+        EPRole other = (EPRole) obj;
+        return (this.getName() == null || other.getName() == null) ? 1 : getName().equals(other.getName()) ? 0 : 1;
+    }
 }
index a208633..004f955 100644 (file)
@@ -50,7 +50,7 @@ public class CentralRoleFunction implements Serializable, Comparable {
        private Long createdId;
        private Long modifiedId;
        private Serializable auditUserId;
-       private Set auditTrail;
+       private transient Set auditTrail;
        private Long rowNum;
        private String code;
        private String name;
index 17007a5..1e2ca31 100644 (file)
@@ -42,7 +42,7 @@ import java.util.Objects;
 
 @SuppressWarnings("rawtypes")
 public class CentralV2UserApp implements Serializable, Comparable{
-       
+
        /**
         * 
         */
@@ -51,77 +51,73 @@ public class CentralV2UserApp implements Serializable, Comparable{
        private CentralApp app;
        private CentralV2Role role;
        private Integer priority;
-       
-       
-       
+
        public Long getUserId() {
                return userId;
        }
 
-
-
        public void setUserId(Long userId) {
                this.userId = userId;
        }
 
-
-
        public CentralApp getApp() {
                return app;
        }
 
-
-
        public void setApp(CentralApp app) {
                this.app = app;
        }
 
-
-
        public CentralV2Role getRole() {
                return role;
        }
 
-
-
        public void setRole(CentralV2Role role) {
                this.role = role;
        }
 
-
-
        public Integer getPriority() {
                return priority;
        }
 
-
-
        public void setPriority(Integer priority) {
                this.priority = priority;
        }
 
        @Override
-       public boolean equals(Object other) {
-               if (this == other) {
-                       return true;
-               }
-               if (!(other instanceof CentralV2UserApp)) {
-                       return false;
-               }
-               CentralV2UserApp castOther = (CentralV2UserApp) other;
-               return Objects.equals(this.userId, castOther.userId) &&
-                       Objects.equals(this.app, castOther.app) &&
-                       Objects.equals(this.role, castOther.role) &&
-                       Objects.equals(this.priority, castOther.priority);
-       }
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((app == null) ? 0 : app.hashCode());
+        result = prime * result + ((priority == null) ? 0 : priority.hashCode());
+        result = prime * result + ((role == null) ? 0 : role.hashCode());
+        result = prime * result + ((userId == null) ? 0 : userId.hashCode());
+        return result;
+    }
+
+    @Override
+    public boolean equals(Object other) {
+        if (this == other) {
+            return true;
+        }
+        if (!(other instanceof CentralV2UserApp)) {
+            return false;
+        }
+        CentralV2UserApp castOther = (CentralV2UserApp) other;
+        return Objects.equals(this.userId, castOther.userId) &&
+            Objects.equals(this.app, castOther.app) &&
+            Objects.equals(this.role, castOther.role) &&
+            Objects.equals(this.priority, castOther.priority);
+    }
 
        public int compareTo(Object other){
            CentralV2UserApp castOther = (CentralV2UserApp) other;
 
-           Long c1 = (this.getUserId()==null ? 0 : this.getUserId()) + (this.priority==null ? 0 : this.priority);
-           Long c2 = (castOther.getUserId()==null ? 0 : castOther.getUserId()) + (castOther.getApp()==null||castOther.getApp().getId()==null ? 0 : castOther.getApp().getId()) + (castOther.priority==null ? 0 : castOther.priority);
+        Long c1 = (this.getUserId() == null ? 0 : this.getUserId()) + (this.priority == null ? 0 : this.priority);
+        Long c2 = (castOther.getUserId() == null ? 0 : castOther.getUserId());
+        c2 += (castOther.getApp() == null || castOther.getApp().getId() == null ? 0 : castOther.getApp().getId());
+        c2 += (castOther.priority == null ? 0 : castOther.priority);
 
            return c1.compareTo(c2);
        }
-       
 }
index 43d0cae..9fa9347 100644 (file)
                        <artifactId>lombok</artifactId>
                        <optional>true</optional>
                </dependency>
+               <dependency>
+                       <groupId>org.onap.portal.sdk</groupId>
+                       <artifactId>epsdk-logger</artifactId>
+                       <version>2.6.0-SNAPSHOT</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.onap.portal.sdk</groupId>
+                       <artifactId>epsdk-logger</artifactId>
+                       <version>2.6.0-SNAPSHOT</version>
+               </dependency>
+               <dependency>
+                       <groupId>org.onap.portal.sdk</groupId>
+                       <artifactId>epsdk-core</artifactId>
+                       <version>2.6.0-SNAPSHOT</version>
+               </dependency>
                <dependency>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-starter-test</artifactId>
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/SchemaInfo.java b/portal-BE/src/main/java/org/onap/portal/domain/db/SchemaInfo.java
new file mode 100644 (file)
index 0000000..dee9aa5
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+CREATE TABLE `schema_info` (
+        `SCHEMA_ID` varchar(25) NOT NULL,
+        `SCHEMA_DESC` varchar(75) NOT NULL,
+        `DATASOURCE_TYPE` varchar(100) DEFAULT NULL,
+        `CONNECTION_URL` varchar(200) NOT NULL,
+        `USER_NAME` varchar(45) NOT NULL,
+        `PASSWORD` varchar(45) DEFAULT NULL,
+        `DRIVER_CLASS` varchar(100) NOT NULL,
+        `MIN_POOL_SIZE` int(11) NOT NULL,
+        `MAX_POOL_SIZE` int(11) NOT NULL,
+        `IDLE_CONNECTION_TEST_PERIOD` int(11) NOT NULL
+        )
+*/
+
+@Table(name = "schema_info")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class SchemaInfo {
+       @Id
+       @Column(name = "SCHEMA_ID", length = 25, nullable = false)
+       @Size(max = 25)
+       @SafeHtml
+       private String schemaId;
+       @Column(name = "SCHEMA_DESC", length = 75, nullable = false)
+       @Size(max = 75)
+       @SafeHtml
+       @NotNull
+       private String schemaDesc;
+       @Column(name = "DATASOURCE_TYPE", length = 100, columnDefinition = "varchar(100) DEFAULT NULL")
+       @Size(max = 100)
+       @SafeHtml
+       private String datasourceType;
+       @Column(name = "CONNECTION_URL", length = 200, nullable = false)
+       @Size(max = 200)
+       @SafeHtml
+       @NotNull
+       private String connectionUrl;
+       @Column(name = "USER_NAME", length = 45, nullable = false)
+       @Size(max = 45)
+       @SafeHtml
+       @NotNull
+       private String userName;
+       @Column(name = "PASSWORD", length = 45, columnDefinition = "varchar(45) default null")
+       @Size(max = 45)
+       @SafeHtml
+       private String password;
+       @Column(name = "DRIVER_CLASS", length = 100, nullable = false)
+       @Size(max = 100)
+       @SafeHtml
+       @NotNull
+       private String driverClass;
+       @Column(name = "MIN_POOL_SIZE", nullable = false)
+       @NotNull
+       private Long minPoolSize;
+       @Column(name = "MAX_POOL_SIZE", nullable = false)
+       @NotNull
+       private Long maxPoolSize;
+       @Column(name = "IDLE_CONNECTION_TEST_PERIOD", nullable = false)
+       @NotNull
+       private Long idleConnectionTestPeriod;
+
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/VUrlAccess.java b/portal-BE/src/main/java/org/onap/portal/domain/db/VUrlAccess.java
new file mode 100644 (file)
index 0000000..1638d4e
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import org.hibernate.annotations.Immutable;
+import org.hibernate.annotations.Subselect;
+
+@Entity
+@Table(name = "v_url_access")
+@Immutable
+@Subselect("select distinct m.action as url, m.function_cd"
+        + " from fn_menu m"
+        + " where (m.action is not null)"
+        + "union"
+        + " select distinct t.action as url, t.function_cd"
+        + " from fn_tab t"
+        + " where (t.action is not null)"
+        + "union"
+        + " select r.restricted_url as url, r.function_cd"
+        + " from fn_restricted_url r")
+@Getter
+@NoArgsConstructor
+public class VUrlAccess {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "id", nullable = false)
+       private Long id;
+       @Column(name = "url", length = 200)
+       private String url;
+
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrFavoriteReports.java b/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrFavoriteReports.java
new file mode 100644 (file)
index 0000000..2fab70e
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.cr;
+
+import java.io.Serializable;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.Table;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.Positive;
+import lombok.AllArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.onap.portal.domain.db.cr.CrFavoriteReports.CrFavoriteReportsId;
+
+
+/*
+
+CREATE TABLE `cr_favorite_reports` (
+        `user_id` int(11) NOT NULL,
+        `rep_id` int(11) NOT NULL,
+        PRIMARY KEY (`user_id`,`rep_id`)
+        )
+*/
+
+
+@Table(name = "cr_favorite_reports")
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode
+@Getter
+@Setter
+@IdClass(CrFavoriteReportsId.class)
+@Entity
+public class CrFavoriteReports {
+       @Id
+       @Column(name = "user_id", length = 11, nullable = false)
+       @Digits(integer = 11, fraction = 0)
+       @Positive
+       private Long userId;
+       @Id
+       @Column(name = "rep_id", length = 11, nullable = false)
+       @Digits(integer = 11, fraction = 0)
+       @Positive
+       private Long repId;
+
+       @Getter
+       @Setter
+       @EqualsAndHashCode
+       @AllArgsConstructor
+       @NoArgsConstructor
+       public static class CrFavoriteReportsId implements Serializable {
+              private Long userId;
+              private Long repId;
+       }
+}
+
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrFilehistLog.java b/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrFilehistLog.java
new file mode 100644 (file)
index 0000000..c96806a
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.cr;
+
+import java.time.LocalDateTime;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.Positive;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.hibernate.validator.constraints.URL;
+
+/*
+
+CREATE TABLE `cr_filehist_log` (
+        `schedule_id` decimal(11,0) NOT NULL,
+        `url` varchar(4000) DEFAULT NULL,
+        `notes` varchar(3500) DEFAULT NULL,
+        `run_time` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
+        )
+*/
+
+
+@Table(name = "cr_filehist_log")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class CrFilehistLog {
+       @Id
+       @Column(name = "schedule_id", length = 11, nullable = false)
+       @Digits(integer = 11, fraction = 0)
+       @Positive
+       private Long scheduledId;
+       //TODO URL @URL
+       @URL
+       @Column(name = "url", length = 4000, columnDefinition = "varchar(4000) DEFAULT NULL")
+       @Size(max = 4000)
+       @SafeHtml
+       private String url;
+       @Column(name = "notes", length = 3500, columnDefinition = "varchar(3500) DEFAULT NULL")
+       @SafeHtml
+       private String notes;
+       @Column(name = "run_time", nullable = false, columnDefinition = "datetime DEFAULT current_timestamp() ON UPDATE current_timestamp()")
+       private LocalDateTime runTime;
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrFolder.java b/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrFolder.java
new file mode 100644 (file)
index 0000000..a2c4240
--- /dev/null
@@ -0,0 +1,132 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.cr;
+
+import java.time.LocalDateTime;
+import java.util.ArrayList;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Index;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
+import javax.validation.constraints.Positive;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+
+CREATE TABLE `cr_folder` (
+        `folder_id` int(11) NOT NULL,
+        `folder_name` varchar(50) NOT NULL,
+        `descr` varchar(500) DEFAULT NULL,
+        `create_id` int(11) NOT NULL,
+        `create_date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
+        `parent_folder_id` int(11) DEFAULT NULL,
+        `public_yn` varchar(1) NOT NULL DEFAULT 'n',
+        PRIMARY KEY (`folder_id`),
+        KEY `fk_parent_key_cr_folder` (`parent_folder_id`),
+        CONSTRAINT `fk_parent_key_cr_folder` FOREIGN KEY (`parent_folder_id`) REFERENCES `cr_folder` (`folder_id`)
+        )
+*/
+
+
+@Table(name = "cr_folder", indexes = {
+        @Index(name = "fk_parent_key_cr_folder", columnList = "parent_folder_id")
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class CrFolder {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "folder_id", length = 11, nullable = false)
+       @Digits(integer = 11, fraction = 0)
+       @Positive
+       private Long folderId;
+       @Column(name = "folder_name", length = 50, nullable = false)
+       @Size(max = 50)
+       @NotNull
+       @SafeHtml
+       private String folderName;
+       @Column(name = "descr", length = 500, columnDefinition = "varchar(500) DEFAULT NULL")
+       @Size(max = 500)
+       @SafeHtml
+       private String descr;
+       @Column(name = "create_id", length = 50, nullable = false)
+       @Digits(integer = 11, fraction = 0)
+       @Positive
+       private Long createId;
+       @Column(name = "create_date", nullable = false, columnDefinition = "datetime DEFAULT current_timestamp() ON UPDATE current_timestamp()")
+       @NotNull
+       private LocalDateTime createDate;
+       @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+       @JoinColumn(name = "parent_Folder_Id")
+       private CrFolder parentFolderId;
+       @Column(name = "public_Yn", length = 1, nullable = false, columnDefinition = "varchar(1) DEFAULT 'n'")
+       @Pattern(regexp = "[YNyn]")
+       @SafeHtml
+       @NotNull
+       private String publicYn;
+       @OneToMany(
+               targetEntity = CrFolder.class,
+               mappedBy = "parentFolderId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<CrFolder> crFolders = new ArrayList<>();
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrFolderAccess.java b/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrFolderAccess.java
new file mode 100644 (file)
index 0000000..44507ac
--- /dev/null
@@ -0,0 +1,110 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.cr;
+
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+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.NotNull;
+import javax.validation.constraints.Pattern;
+import javax.validation.constraints.Positive;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+
+CREATE TABLE `cr_folder_access` (
+        `folder_access_id` decimal(11,0) NOT NULL,
+        `folder_id` decimal(11,0) NOT NULL,
+        `order_no` decimal(11,0) NOT NULL,
+        `role_id` decimal(11,0) DEFAULT NULL,
+        `user_id` decimal(11,0) DEFAULT NULL,
+        `read_only_yn` varchar(1) NOT NULL DEFAULT 'n',
+        PRIMARY KEY (`folder_access_id`)
+        )
+*/
+
+
+@Table(name = "cr_folder_access")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class CrFolderAccess {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "folder_access_id", length = 11, nullable = false)
+       @Digits(integer = 11, fraction = 0)
+       @Positive
+       private Long folderAccessId;
+       @Column(name = "folder_id", nullable = false)
+       @Digits(integer = 11, fraction = 0)
+       @Positive
+       @NotNull
+       private Long folderId;
+       @Column(name = "order_no", nullable = false)
+       @Digits(integer = 11, fraction = 0)
+       @Positive
+       @NotNull
+       private Long orderNo;
+       @Column(name = "role_id")
+       @Digits(integer = 11, fraction = 0)
+       @Positive
+       private Long roleId;
+       @Column(name = "user_id")
+       @Digits(integer = 11, fraction = 0)
+       @Positive
+       private Long userId;
+       @Column(name = "read_only_yn", length = 1, nullable = false, columnDefinition = "varchar(1) default 'n'")
+       @Pattern(regexp = "[YNyn]")
+       @SafeHtml
+       @NotNull
+       private String readOnlyYn;
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrLuFileType.java b/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrLuFileType.java
new file mode 100644 (file)
index 0000000..4638460
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.cr;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
+import javax.validation.constraints.Positive;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+
+CREATE TABLE `cr_lu_file_type` (
+        `lookup_id` decimal(2,0) NOT NULL,
+        `lookup_descr` varchar(255) NOT NULL,
+        `active_yn` char(1) DEFAULT 'y',
+        `error_code` decimal(11,0) DEFAULT NULL,
+        PRIMARY KEY (`lookup_id`)
+        )
+*/
+
+
+@Table(name = "cr_lu_file_type")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class CrLuFileType {
+       @Id
+       @Column(name = "lookup_id", length = 2, nullable = false)
+       @Digits(integer = 2, fraction = 0)
+       @Positive
+       private Long lookupId;
+       @Column(name = "lookup_descr", nullable = false)
+       @Size(max = 255)
+       @SafeHtml
+       @NotNull
+       private String lookupDescr;
+       @Column(name = "active_yn", length = 1, columnDefinition = "character(1) default 'y'")
+       @Pattern(regexp = "[YNyn]")
+       @Size(max = 1)
+       @SafeHtml
+       private String activeYn;
+       @Column(name = "error_code")
+       @Digits(integer = 11, fraction = 0)
+       @Positive
+       private Long errorCode;
+       @OneToMany(
+               targetEntity = CrReportFileHistory.class,
+               mappedBy = "fileTypeId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<CrReportFileHistory> crReportFileHistories = new ArrayList<>();
+
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrRaptorActionImg.java b/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrRaptorActionImg.java
new file mode 100644 (file)
index 0000000..ed153b4
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.cr;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+
+CREATE TABLE `cr_raptor_action_img` (
+        `image_id` varchar(100) NOT NULL,
+        `image_loc` varchar(400) DEFAULT NULL,
+        PRIMARY KEY (`image_id`)
+        )
+*/
+
+
+@Table(name = "cr_raptor_action_img")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class CrRaptorActionImg {
+       @Id
+       @Column(name = "image_id", length = 100, nullable = false)
+       @Size(max = 100)
+       @SafeHtml
+       @NotNull
+       private String imageId;
+       @Column(name = "image_loc", length = 400, columnDefinition = "varchar(400) DEFAULT NULL")
+       @Size(max = 400)
+       @SafeHtml
+       private String imageLoc;
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrRaptorPdfImg.java b/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrRaptorPdfImg.java
new file mode 100644 (file)
index 0000000..129e6e0
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.cr;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+CREATE TABLE `cr_raptor_pdf_img` (
+        `image_id` varchar(100) NOT NULL,
+        `image_loc` varchar(400) DEFAULT NULL,
+        PRIMARY KEY (`image_id`)
+        )
+*/
+
+@Table(name = "cr_raptor_pdf_img")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class CrRaptorPdfImg {
+       @Id
+       @Column(name = "image_id", length = 100, nullable = false)
+       @Size(max = 100)
+       @SafeHtml
+       @NotNull
+       private String imageId;
+       @Column(name = "image_loc", length = 400)
+       @Size(max = 400)
+       @SafeHtml
+       private String imageLoc;
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrRemoteSchemaInfo.java b/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrRemoteSchemaInfo.java
new file mode 100644 (file)
index 0000000..95d991f
--- /dev/null
@@ -0,0 +1,87 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.cr;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+CREATE TABLE `cr_remote_schema_info` (
+        `schema_prefix` varchar(5) NOT NULL,
+        `schema_desc` varchar(75) NOT NULL,
+        `datasource_type` varchar(100) DEFAULT NULL,
+        PRIMARY KEY (`schema_prefix`)
+        )
+*/
+
+
+@Table(name = "cr_remote_schema_info")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class CrRemoteSchemaInfo {
+       @Id
+       @Column(name = "schema_prefix", length = 5, nullable = false)
+       @Size(max = 5)
+       @SafeHtml
+       @NotNull
+       private String schemaPrefix;
+       @Column(name = "schema_desc", length = 75, nullable = false)
+       @Size(max = 75)
+       @NotNull
+       @SafeHtml
+       private String schemaDesc;
+       @Column(name = "datasource_type", length = 100)
+       @Size(max = 100)
+       @SafeHtml
+       private String datasourceType;
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrReport.java b/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrReport.java
new file mode 100644 (file)
index 0000000..c25f806
--- /dev/null
@@ -0,0 +1,239 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.cr;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+import java.util.ArrayList;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Embeddable;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.Id;
+import javax.persistence.Index;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.FutureOrPresent;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.PastOrPresent;
+import javax.validation.constraints.Pattern;
+import javax.validation.constraints.Positive;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+
+CREATE TABLE `cr_report` (
+        `rep_id` decimal(11,0) NOT NULL,
+        `title` varchar(100) NOT NULL,
+        `descr` varchar(255) DEFAULT NULL,
+        `public_yn` varchar(1) NOT NULL DEFAULT 'n',
+        `report_xml` text DEFAULT NULL,
+        `create_id` decimal(11,0) DEFAULT NULL,
+        `create_date` timestamp NOT NULL DEFAULT current_timestamp(),
+        `maint_id` decimal(11,0) DEFAULT NULL,
+        `maint_date` timestamp NOT NULL DEFAULT current_timestamp(),
+        `menu_id` varchar(500) DEFAULT NULL,
+        `menu_approved_yn` varchar(1) NOT NULL DEFAULT 'n',
+        `owner_id` decimal(11,0) DEFAULT NULL,
+        `folder_id` int(11) DEFAULT 0,
+        `dashboard_type_yn` varchar(1) DEFAULT 'n',
+        `dashboard_yn` varchar(1) DEFAULT 'n',
+        PRIMARY KEY (`rep_id`),
+        KEY `cr_report_create_idpublic_yntitle` (`create_id`,`public_yn`,`title`) USING BTREE
+        )
+*/
+
+
+@Table(name = "cr_report", indexes = {
+        @Index(name = "cr_report_create_idpublic_yntitle", columnList = "create_id, public_yn, title")
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode
+@Getter
+@Setter
+@Entity
+@Embeddable
+public class CrReport implements Serializable {
+       @Id
+       @Column(name = "rep_id", length = 11, nullable = false)
+       @Digits(integer = 11, fraction = 0)
+       @Positive
+       private Long repId;
+       @Column(name = "title", length = 100, nullable = false)
+       @Size(max = 100)
+       @SafeHtml
+       @NotNull
+       private String title;
+       @Column(name = "descr", length = 255, columnDefinition = "varchar(255) DEFAULT NULL")
+       @Size(max = 255)
+       @SafeHtml
+       private String descr;
+       @Column(name = "public_yn", nullable = false, length = 1, columnDefinition = "character varying(1) default 'n'")
+       @Pattern(regexp = "[YNyn]")
+       @Size(max = 1)
+       @SafeHtml
+       @NotNull
+       private String publicYn;
+       @Column(name = "report_xml", columnDefinition = "text DEFAULT NULL")
+       private String reportXml;
+       @Column(name = "create_id", columnDefinition = "decimal(11,0) DEFAULT NULL")
+       @Digits(integer = 11, fraction = 0)
+       @Positive
+       private Long createId;
+       @Column(name = "create_date", nullable = false, columnDefinition = "timestamp DEFAULT current_timestamp()")
+       @PastOrPresent
+       @NotNull
+       protected LocalDateTime createDate;
+       @Column(name = "maint_id", columnDefinition = "decimal(11,0) DEFAULT NULL")
+       @Digits(integer = 11, fraction = 0)
+       private Long maintId;
+       @Column(name = "maint_date", nullable = false, columnDefinition = "timestamp DEFAULT current_timestamp()")
+       @PastOrPresent
+       @NotNull
+       protected LocalDateTime maintDate;
+       @Column(name = "menu_id", length = 500, columnDefinition = "varchar(500) DEFAULT NULL")
+       @Size(max = 500)
+       @SafeHtml
+       private String menuId;
+       @Column(name = "menu_approved_yn", nullable = false, length = 1, columnDefinition = "character varying(1) default 'n'")
+       @Pattern(regexp = "[YNyn]")
+       @Size(max = 1)
+       @SafeHtml
+       @NotNull
+       private String menuApprovedYn;
+       @Column(name = "owner_id", columnDefinition = "decimal(11,0) DEFAULT NULL")
+       @Digits(integer = 11, fraction = 0)
+       private Long ownerId;
+       @Column(name = "folder_id", length = 11, columnDefinition = "int(11) DEFAULT 0")
+       @Digits(integer = 11, fraction = 0)
+       @Positive
+       private Integer folderId;
+       @Column(name = "dashboard_type_yn", length = 1, columnDefinition = "character varying(1) default 'n'")
+       @Pattern(regexp = "[YNyn]")
+       @Size(max = 1)
+       @SafeHtml
+       private String dashboardTypeYn;
+       @Column(name = "dashboard_yn", length = 1, columnDefinition = "character varying(1) default 'n'")
+       @Pattern(regexp = "[YNyn]")
+       @Size(max = 1)
+       @SafeHtml
+       private String dashboardYn;
+
+       public CrReport(
+               @Digits(integer = 11, fraction = 0) @Positive Long repId,
+               @Size(max = 100) @SafeHtml @NotNull String title,
+               @Size(max = 255) @SafeHtml String descr,
+               @Pattern(regexp = "[YNyn]") @Size(max = 1) @SafeHtml @NotNull String publicYn,
+               @SafeHtml String reportXml,
+               @Digits(integer = 11, fraction = 0) @Positive Long createId,
+               @FutureOrPresent @NotNull LocalDateTime createDate,
+               @Digits(integer = 11, fraction = 0) Long maintId,
+               @FutureOrPresent @NotNull LocalDateTime maintDate,
+               @Size(max = 500) @SafeHtml String menuId,
+               @Pattern(regexp = "[YNyn]") @Size(max = 1) @SafeHtml @NotNull String menuApprovedYn,
+               @Digits(integer = 11, fraction = 0) Long ownerId,
+               @Digits(integer = 11, fraction = 0) @Positive Integer folderId,
+               @Pattern(regexp = "[YNyn]") @Size(max = 1) @SafeHtml String dashboardTypeYn,
+               @Pattern(regexp = "[YNyn]") @Size(max = 1) @SafeHtml String dashboardYn) {
+              this.repId = repId;
+              this.title = title;
+              this.descr = descr;
+              this.publicYn = publicYn;
+              this.reportXml = reportXml;
+              this.createId = createId;
+              this.createDate = createDate;
+              this.maintId = maintId;
+              this.maintDate = maintDate;
+              this.menuId = menuId;
+              this.menuApprovedYn = menuApprovedYn;
+              this.ownerId = ownerId;
+              this.folderId = folderId;
+              this.dashboardTypeYn = dashboardTypeYn;
+              this.dashboardYn = dashboardYn;
+       }
+
+       @OneToMany(
+               targetEntity = CrReportSchedule.class,
+               mappedBy = "repId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<CrReportSchedule> crReportSchedules = new ArrayList<>();
+       @OneToMany(
+               targetEntity = CrReportAccess.class,
+               mappedBy = "repId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<CrReportAccess> crReportAccesses = new ArrayList<>();
+       @OneToMany(
+               targetEntity = CrReportLog.class,
+               mappedBy = "repId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<CrReportLog> crReportLogs = new ArrayList<>();
+       @OneToMany(
+               targetEntity = CrReportEmailSentLog.class,
+               mappedBy = "repId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<CrReportEmailSentLog> crReportEmailSentLogs = new ArrayList<>();
+       @OneToMany(
+               targetEntity = CrReportFileHistory.class,
+               mappedBy = "repId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<CrReportFileHistory> crReportFileHistories = new ArrayList<>();
+
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrReportAccess.java b/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrReportAccess.java
new file mode 100644 (file)
index 0000000..44a53d3
--- /dev/null
@@ -0,0 +1,123 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.cr;
+
+import java.io.Serializable;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.validation.Valid;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
+import javax.validation.constraints.Positive;
+import lombok.AllArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.onap.portal.domain.db.cr.CrReportAccess.CrReportAccessId;
+
+/*
+
+CREATE TABLE `cr_report_access` (
+        `rep_id` decimal(11,0) NOT NULL,
+        `order_no` decimal(11,0) NOT NULL,
+        `role_id` decimal(11,0) DEFAULT NULL,
+        `user_id` decimal(11,0) DEFAULT NULL,
+        `read_only_yn` varchar(1) NOT NULL DEFAULT 'n',
+        PRIMARY KEY (`rep_id`,`order_no`),
+        CONSTRAINT `fk_cr_repor_ref_8550_cr_repor` FOREIGN KEY (`rep_id`) REFERENCES `cr_report` (`rep_id`)
+        )
+*/
+
+
+@Table(name = "cr_report_access")
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode
+@Getter
+@Setter
+@Entity
+@IdClass(CrReportAccessId.class)
+public class CrReportAccess implements Serializable{
+       @Id
+       @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+       @JoinColumn(name = "rep_id")
+       @Valid
+       private CrReport repId;
+       @Id
+       @Column(name = "order_no", length = 11, nullable = false)
+       @Digits(integer = 11, fraction = 0)
+       @Positive
+       @NotNull
+       private Long orderNo;
+       @Column(name = "role_id", columnDefinition = "decimal(11,0) DEFAULT NULL")
+       @Digits(integer = 11, fraction = 0)
+       @Positive
+       private Long roleId;
+       @Column(name = "user_id", columnDefinition = "decimal(11,0) DEFAULT NULL")
+       @Digits(integer = 11, fraction = 0)
+       @Positive
+       private Long userId;
+       @Column(name = "menu_approved_yn", nullable = false, length = 1, columnDefinition = "character varying(1) default 'n'")
+       @Pattern(regexp = "[YNyn]")
+       @SafeHtml
+       @NotNull
+       private String menuApprovedYn;
+
+       @NoArgsConstructor
+       @AllArgsConstructor
+       @EqualsAndHashCode
+       @Getter
+       @Setter
+       public static class CrReportAccessId implements Serializable{
+              private CrReport repId;
+              private Long orderNo;
+       }
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrReportDwnldLog.java b/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrReportDwnldLog.java
new file mode 100644 (file)
index 0000000..368bd0f
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.cr;
+
+import java.time.LocalDateTime;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.FutureOrPresent;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Positive;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+CREATE TABLE `cr_report_dwnld_log` (
+        `user_id` decimal(11,0) NOT NULL,
+        `rep_id` int(11) NOT NULL,
+        `file_name` varchar(100) NOT NULL,
+        `dwnld_start_time` timestamp NOT NULL DEFAULT current_timestamp(),
+        `record_ready_time` timestamp NOT NULL DEFAULT current_timestamp(),
+        `filter_params` varchar(2000) DEFAULT NULL
+        )
+*/
+
+
+@Table(name = "cr_report_dwnld_log")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class CrReportDwnldLog {
+       @Id
+       @Column(name = "user_id", nullable = false)
+       @Digits(integer = 11, fraction = 0)
+       @Positive
+       private Long userId;
+       @Column(name = "rep_id", length = 11, nullable = false)
+       @Digits(integer = 11, fraction = 0)
+       @NotNull
+       private Integer repId;
+       @Column(name = "file_name", length = 100, nullable = false)
+       @Size(max = 100)
+       @SafeHtml
+       @NotNull
+       private String fileName;
+       @Column(name = "dwnld_start_time", nullable = false, columnDefinition = "datetime DEFAULT current_timestamp()")
+       @FutureOrPresent
+       @NotNull
+       protected LocalDateTime dwnldStartTime;
+       @Column(name = "record_ready_time", nullable = false, columnDefinition = "datetime DEFAULT current_timestamp()")
+       @FutureOrPresent
+       protected LocalDateTime recordReadyTime;
+       @Column(name = "filter_params", length = 2000, columnDefinition = "varchar(2000) DEFAULT NULL")
+       @Size(max = 2000)
+       @SafeHtml
+       private String filterParams;
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrReportEmailSentLog.java b/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrReportEmailSentLog.java
new file mode 100644 (file)
index 0000000..cb36395
--- /dev/null
@@ -0,0 +1,127 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.cr;
+
+import java.time.LocalDateTime;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Index;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.validation.Valid;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.FutureOrPresent;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
+import javax.validation.constraints.Positive;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+CREATE TABLE `cr_report_email_sent_log` (
+        `log_id` int(11) NOT NULL,
+        `schedule_id` decimal(11,0) DEFAULT NULL,
+        `gen_key` varchar(25) NOT NULL,
+        `rep_id` decimal(11,0) NOT NULL,
+        `user_id` decimal(11,0) DEFAULT NULL,
+        `sent_date` timestamp NOT NULL DEFAULT current_timestamp(),
+        `access_flag` varchar(1) NOT NULL DEFAULT 'y',
+        `touch_date` timestamp NOT NULL DEFAULT current_timestamp(),
+        PRIMARY KEY (`log_id`),
+        KEY `fk_cr_report_rep_id` (`rep_id`),
+        CONSTRAINT `fk_cr_report_rep_id` FOREIGN KEY (`rep_id`) REFERENCES `cr_report` (`rep_id`)
+        )
+*/
+
+@Table(name = "cr_report_email_sent_log", indexes = {
+        @Index(name = "fk_cr_report_rep_id", columnList = "rep_id")
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class CrReportEmailSentLog {
+       @Id
+       @Column(name = "log_id", nullable = false)
+       @Digits(integer = 11, fraction = 0)
+       @Positive
+       private Integer logId;
+       @Column(name = "schedule_id", columnDefinition = "decimal(11,0) DEFAULT NULL")
+       @Digits(integer = 11, fraction = 0)
+       @Positive
+       private Long scheduleId;
+       @Column(name = "gen_key", length = 25, nullable = false)
+       @Size(max = 25)
+       @SafeHtml
+       @NotNull
+       private String genKey;
+       @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+       @JoinColumn(name = "rep_id", nullable = false)
+       @NotNull
+       @Valid
+       private CrReport repId;
+       @Column(name = "user_id", columnDefinition = "decimal(11,0) DEFAULT NULL")
+       @Digits(integer = 11, fraction = 0)
+       private Long userId;
+       @Column(name = "sent_date", nullable = false, columnDefinition = "datetime default now()")
+       @FutureOrPresent
+       protected LocalDateTime sentDate;
+       @Column(name = "access_flag", nullable = false, length = 1, columnDefinition = "character varying(1) default 'y'")
+       @Pattern(regexp = "[YNyn]")
+       @Size(max = 1)
+       @SafeHtml
+       @NotNull
+       private String accessFlag;
+       @Column(name = "touch_date", nullable = false, columnDefinition = "datetime default now()")
+       @FutureOrPresent
+       protected LocalDateTime touchDate;
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrReportFileHistory.java b/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrReportFileHistory.java
new file mode 100644 (file)
index 0000000..049057d
--- /dev/null
@@ -0,0 +1,180 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.cr;
+
+import java.time.LocalDateTime;
+import java.util.ArrayList;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.Id;
+import javax.persistence.Index;
+import javax.persistence.JoinColumn;
+import javax.persistence.JoinTable;
+import javax.persistence.ManyToMany;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.validation.Valid;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.FutureOrPresent;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
+import javax.validation.constraints.Positive;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.hibernate.validator.constraints.URL;
+import org.onap.portal.domain.db.fn.FnUser;
+
+/*
+CREATE TABLE `cr_report_file_history` (
+        `hist_id` int(11) NOT NULL,
+        `sched_user_id` decimal(11,0) NOT NULL,
+        `schedule_id` decimal(11,0) NOT NULL,
+        `user_id` decimal(11,0) NOT NULL,
+        `rep_id` decimal(11,0) DEFAULT NULL,
+        `run_date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
+        `recurrence` varchar(50) DEFAULT NULL,
+        `file_type_id` decimal(2,0) DEFAULT NULL,
+        `file_name` varchar(80) DEFAULT NULL,
+        `file_blob` blob DEFAULT NULL,
+        `file_size` decimal(11,0) DEFAULT NULL,
+        `raptor_url` varchar(4000) DEFAULT NULL,
+        `error_yn` char(1) DEFAULT 'n',
+        `error_code` decimal(11,0) DEFAULT NULL,
+        `deleted_yn` char(1) DEFAULT 'n',
+        `deleted_by` decimal(38,0) DEFAULT NULL,
+        PRIMARY KEY (`hist_id`),
+        KEY `sys_c0014614` (`file_type_id`),
+        KEY `sys_c0014615` (`rep_id`),
+        CONSTRAINT `sys_c0014614` FOREIGN KEY (`file_type_id`) REFERENCES `cr_lu_file_type` (`lookup_id`),
+        CONSTRAINT `sys_c0014615` FOREIGN KEY (`rep_id`) REFERENCES `cr_report` (`rep_id`)
+        )
+*/
+
+@Table(name = "cr_report_file_history", indexes = {
+        @Index(name = "sys_c0014617", columnList = "user_id"),
+        @Index(name = "sys_c0014614", columnList = "file_type_id"),
+        @Index(name = "sys_c0014615", columnList = "rep_id")
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class CrReportFileHistory {
+       @Id
+       @Column(name = "hist_id", nullable = false, length = 11)
+       @Digits(integer = 11, fraction = 0)
+       private Long histId;
+       @Column(name = "sched_user_id", nullable = false)
+       @Digits(integer = 11, fraction = 0)
+       @NotNull
+       private Long schedUserId;
+       @Column(name = "schedule_id", nullable = false)
+       @Digits(integer = 11, fraction = 0)
+       @NotNull
+       private Long scheduleId;
+       @Column(name = "user_id", nullable = false)
+       @Digits(integer = 11, fraction = 0)
+       @NotNull
+       private Long userId;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "rep_id")
+       @Valid
+       private CrReport repId;
+       @Column(name = "run_date", nullable = false, columnDefinition = "datetime DEFAULT current_timestamp() ON UPDATE current_timestamp()")
+       @FutureOrPresent
+       private LocalDateTime runDate;
+       @Column(name = "recurrence", length = 50, columnDefinition = "varchar(50) DEFAULT NULL")
+       @Size(max = 50)
+       @SafeHtml
+       private String recurrence;
+       @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+       @JoinColumn(name = "file_type_id")
+       @Valid
+       private CrLuFileType fileTypeId;
+       @Column(name = "file_name", length = 80, columnDefinition = "varchar(80) DEFAULT NULL")
+       @Size(max = 80)
+       @SafeHtml
+       private String fileName;
+       @Column(name = "file_blob", columnDefinition = "blob DEFAULT NULL")
+       private byte[] fileBlob;
+       @Column(name = "file_size", columnDefinition = "decimal(11,0) DEFAULT NULL")
+       @Digits(integer = 11, fraction = 0)
+       @Positive
+       private Long file_size;
+       //TODO URL @URL
+       @URL
+       @Column(name = "raptor_url", length = 4000)
+       @Size(max = 4000)
+       @SafeHtml
+       private String raptorUrl;
+       @Column(name = "error_yn", length = 1, columnDefinition = "character(1) default 'n'")
+       @Pattern(regexp = "[YNyn]")
+       @Size(max = 1)
+       @SafeHtml
+       private String errorYn;
+       @Column(name = "error_code", columnDefinition = "decimal(11,0) DEFAULT NULL")
+       @Digits(integer = 11, fraction = 0)
+       private Long errorCode;
+       @Column(name = "deleted_yn", length = 1, columnDefinition = "character(1) default 'n'")
+       @Pattern(regexp = "[YNyn]")
+       @Size(max = 1)
+       @SafeHtml
+       private String deletedYn;
+       @Column(name = "deleted_by", columnDefinition = "decimal(38,0) DEFAULT NULL")
+       @Digits(integer = 38, fraction = 0)
+       private Long deletedBy;
+
+       @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+       @JoinTable(
+               name = "cr_hist_user_map",
+               joinColumns = {@JoinColumn(name = "hist_id", referencedColumnName = "hist_id")},
+               inverseJoinColumns = {@JoinColumn(name = "user_id", referencedColumnName = "user_id")}
+       )
+       private List<FnUser> fnUserList = new ArrayList<>();
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrReportLog.java b/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrReportLog.java
new file mode 100644 (file)
index 0000000..95088b6
--- /dev/null
@@ -0,0 +1,118 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.cr;
+
+import java.time.LocalDateTime;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Index;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.validation.Valid;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.PastOrPresent;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+CREATE TABLE `cr_report_log` (
+        `rep_id` decimal(11,0) NOT NULL,
+        `log_time` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
+        `user_id` decimal(11,0) NOT NULL,
+        `action` varchar(2000) NOT NULL,
+        `action_value` varchar(50) DEFAULT NULL,
+        `form_fields` varchar(4000) DEFAULT NULL,
+        KEY `fk_cr_repor_ref_17645_cr_repor` (`rep_id`),
+        CONSTRAINT `fk_cr_repor_ref_17645_cr_repor` FOREIGN KEY (`rep_id`) REFERENCES `cr_report` (`rep_id`)
+        )
+*/
+
+@Table(name = "cr_report_log", indexes = {
+        @Index(name = "fk_cr_repor_ref_17645_cr_repor", columnList = "rep_id")
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class CrReportLog {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @JoinColumn(name = "id")
+       private Long id;
+       @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+       @JoinColumn(name = "rep_id")
+       @NotNull
+       @Valid
+       private CrReport repId;
+       @Column(name = "log_time", nullable = false, columnDefinition = "timestamp DEFAULT current_timestamp() ON UPDATE current_timestamp()")
+       @PastOrPresent
+       @NotNull
+       protected LocalDateTime logTime;
+       @Column(name = "user_id", nullable = false)
+       @Digits(integer = 11, fraction = 0)
+       @NotNull
+       private Long userId;
+       @Column(name = "action", length = 2000, nullable = false)
+       @Size(max = 2000)
+       @SafeHtml
+       @NotNull
+       private String action;
+       @Column(name = "action_value", length = 50)
+       @Size(max = 50)
+       @SafeHtml
+       private String actionValue;
+       @Column(name = "form_fields", length = 4000)
+       @Size(max = 4000)
+       @SafeHtml
+       private String formFields;
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrReportSchedule.java b/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrReportSchedule.java
new file mode 100644 (file)
index 0000000..f3935ff
--- /dev/null
@@ -0,0 +1,187 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.cr;
+
+import java.time.LocalDateTime;
+import java.util.ArrayList;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.validation.Valid;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.FutureOrPresent;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
+import javax.validation.constraints.Positive;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+CREATE TABLE `cr_report_schedule` (
+        `schedule_id` decimal(11,0) NOT NULL,
+        `sched_user_id` decimal(11,0) NOT NULL,
+        `rep_id` decimal(11,0) NOT NULL,
+        `enabled_yn` varchar(1) NOT NULL,
+        `start_date` timestamp NOT NULL DEFAULT current_timestamp(),
+        `end_date` timestamp NOT NULL DEFAULT current_timestamp(),
+        `run_date` timestamp NOT NULL DEFAULT current_timestamp(),
+        `recurrence` varchar(50) DEFAULT NULL,
+        `conditional_yn` varchar(1) NOT NULL,
+        `condition_sql` varchar(4000) DEFAULT NULL,
+        `notify_type` int(11) DEFAULT 0,
+        `max_row` int(11) DEFAULT 1000,
+        `initial_formfields` varchar(3500) DEFAULT NULL,
+        `processed_formfields` varchar(3500) DEFAULT NULL,
+        `formfields` varchar(3500) DEFAULT NULL,
+        `condition_large_sql` text DEFAULT NULL,
+        `encrypt_yn` char(1) DEFAULT 'n',
+        `attachment_yn` char(1) DEFAULT 'y',
+        PRIMARY KEY (`schedule_id`),
+        KEY `fk_cr_repor_ref_14707_cr_repor` (`rep_id`),
+        CONSTRAINT `fk_cr_repor_ref_14707_cr_repor` FOREIGN KEY (`rep_id`) REFERENCES `cr_report` (`rep_id`)
+        )
+*/
+
+
+@Table(name = "cr_report_schedule")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class CrReportSchedule {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "schedule_id", length = 11, nullable = false)
+       @Digits(integer = 11, fraction = 0)
+       @Positive
+       private Long scheduleId;
+       @Column(name = "sched_user_id", length = 11, nullable = false)
+       @Digits(integer = 11, fraction = 0)
+       @Positive
+       @NotNull
+       private Long schedUserId;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "rep_id", nullable = false)
+       @Valid
+       @NotNull
+       private CrReport repId;
+       @Column(name = "enabled_yn", length = 1, nullable = false)
+       @Pattern(regexp = "[YNyn]")
+       @Size(max = 1)
+       @SafeHtml
+       @NotNull
+       private String enabledYn;
+       @Column(name = "start_date", nullable = false, columnDefinition = "datetime DEFAULT current_timestamp()")
+       @FutureOrPresent
+       @NotNull
+       private LocalDateTime startDate;
+       @Column(name = "end_date", nullable = false, columnDefinition = "datetime DEFAULT current_timestamp()")
+       @FutureOrPresent
+       @NotNull
+       private LocalDateTime endDate;
+       @Column(name = "run_date", nullable = false, columnDefinition = "datetime DEFAULT current_timestamp()")
+       @FutureOrPresent
+       @NotNull
+       private LocalDateTime runDate;
+       @Column(name = "recurrence_", length = 50, columnDefinition = "varchar(50) DEFAULT NULL")
+       @Size(max = 50)
+       @SafeHtml
+       private String recurrence;
+       @Column(name = "conditional_yn", length = 1, nullable = false)
+       @Pattern(regexp = "[YNyn]")
+       @Size(max = 1)
+       @SafeHtml
+       @NotNull
+       private String conditionalYn;
+       @Column(name = "condition_sql", length = 4000, columnDefinition = "varchar(4000) DEFAULT NULL")
+       @Size(max = 4000)
+       @SafeHtml
+       private String conditionSql;
+       @Column(name = "notify_type", columnDefinition = "int(11) DEFAULT 0")
+       private Integer notifyType;
+       @Column(name = "max_row", columnDefinition = "integer default 1000")
+       private Integer max_row;
+       @Column(name = "initial_formfields", length = 3500, columnDefinition = "varchar(3500) DEFAULT NULL")
+       @Size(max = 3500)
+       @SafeHtml
+       private String initialFormfields;
+       @Column(name = "processed_formfields", length = 3500, columnDefinition = "varchar(3500) DEFAULT NULL")
+       @Size(max = 3500)
+       @SafeHtml
+       private String processedFormfields;
+       @Column(name = "formfields", length = 3500, columnDefinition = "varchar(3500) DEFAULT NULL")
+       @Size(max = 3500)
+       @SafeHtml
+       private String formfields;
+       @Column(name = "condition_large_sql", length = 65535, columnDefinition = "text DEFAULT NULL")
+       private String conditionLargeSql;
+       @Column(name = "encrypt_yn", length = 1, columnDefinition = "character(1) default 'n'")
+       @Pattern(regexp = "[YNyn]")
+       @Size(max = 1)
+       @SafeHtml
+       private String encryptYn;
+       @Column(name = "attachment_yn", length = 1, columnDefinition = "character(1) default 'y'")
+       @Pattern(regexp = "[YNyn]")
+       @Size(max = 1)
+       @SafeHtml
+       private String attachmentYn;
+       @OneToMany(
+               targetEntity = CrReportScheduleUsers.class,
+               mappedBy = "scheduleId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<CrReportScheduleUsers> crReportScheduleUsers = new ArrayList<>();
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrReportScheduleUsers.java b/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrReportScheduleUsers.java
new file mode 100644 (file)
index 0000000..76c213c
--- /dev/null
@@ -0,0 +1,127 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.cr;
+
+import java.io.Serializable;
+import java.math.BigInteger;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.validation.Valid;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotNull;
+import lombok.AllArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.onap.portal.domain.db.cr.CrReportScheduleUsers.CrReportScheduleUsersId;
+
+/*
+
+CREATE TABLE `cr_report_schedule_users` (
+        `schedule_id` decimal(11,0) NOT NULL,
+        `rep_id` decimal(11,0) NOT NULL,
+        `user_id` decimal(11,0) NOT NULL,
+        `role_id` decimal(11,0) DEFAULT NULL,
+        `order_no` decimal(11,0) NOT NULL,
+        PRIMARY KEY (`schedule_id`,`rep_id`,`user_id`,`order_no`),
+        CONSTRAINT `fk_cr_repor_ref_14716_cr_repor` FOREIGN KEY (`schedule_id`) REFERENCES `cr_report_schedule` (`schedule_id`)
+        )
+*/
+
+
+@Table(name = "cr_report_schedule_users")
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode
+@Getter
+@Setter
+@Entity
+@IdClass(CrReportScheduleUsersId.class)
+public class CrReportScheduleUsers {
+       @Id
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "schedule_id", nullable = false)
+       @Valid
+       @NotNull
+       private CrReportSchedule scheduleId;
+       @Id
+       @Column(name = "rep_id", nullable = false)
+       @Digits(integer = 11, fraction = 0)
+       @NotNull
+       private Long repId;
+       @Id
+       @Column(name = "user_id", nullable = false)
+       @Digits(integer = 11, fraction = 0)
+       @NotNull
+       private Long userId;
+       @Column(name = "role_id")
+       @Digits(integer = 11, fraction = 0)
+       private Long roleId;
+       @Id
+       @Column(name = "order_no", nullable = false)
+       @Digits(integer = 11, fraction = 0)
+       @NotNull
+       private Long orderNo;
+
+       @Getter
+       @Setter
+       @EqualsAndHashCode
+       @AllArgsConstructor
+       @NoArgsConstructor
+       public static class CrReportScheduleUsersId implements Serializable {
+              @Valid
+              private CrReportSchedule scheduleId;
+              @Digits(integer = 11, fraction = 0)
+              private Long repId;
+              @Digits(integer = 11, fraction = 0)
+              private Long userId;
+              @Digits(integer = 11, fraction = 0)
+              private Long orderNo;
+       }
+}
\ No newline at end of file
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrReportTemplateMap.java b/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrReportTemplateMap.java
new file mode 100644 (file)
index 0000000..ee17614
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.cr;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+CREATE TABLE `cr_report_template_map` (
+        `report_id` int(11) NOT NULL,
+        `template_file` varchar(200) DEFAULT NULL,
+        PRIMARY KEY (`report_id`)
+        )
+*/
+
+@Table(name = "cr_report_template_map")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class CrReportTemplateMap {
+       @Id
+       @Column(name = "report_id", nullable = false)
+       @NotNull
+       private Long reportId;
+       @Column(name = "template_file", length = 200)
+       @Pattern(regexp = "[YNyn]")
+       @Size(max = 200)
+       @SafeHtml
+       private String templateFile;
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrScheduleActivityLog.java b/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrScheduleActivityLog.java
new file mode 100644 (file)
index 0000000..9c4f88b
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.cr;
+
+import java.time.LocalDateTime;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.FutureOrPresent;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.hibernate.validator.constraints.URL;
+
+/*
+CREATE TABLE `cr_schedule_activity_log` (
+        `schedule_id` decimal(11,0) NOT NULL,
+        `url` varchar(4000) DEFAULT NULL,
+        `notes` varchar(2000) DEFAULT NULL,
+        `run_time` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
+        )
+*/
+
+@Table(name = "cr_schedule_activity_log")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class CrScheduleActivityLog {
+       @Id
+       @Column(name = "schedule_id", nullable = false)
+       @Digits(integer = 11, fraction = 0)
+       private Long scheduleId;
+       //TODO URL
+       @URL
+       @Column(name = "url", length = 4000)
+       @Size(max = 4000)
+       @SafeHtml
+       private String url;
+       @Column(name = "notes", length = 2000)
+       @Size(max = 2000)
+       @SafeHtml
+       private String notes;
+       @Column(name = "run_time", nullable = false, columnDefinition = "datetime DEFAULT current_timestamp() ON UPDATE current_timestamp()")
+       private LocalDateTime runTime;
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrTableJoin.java b/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrTableJoin.java
new file mode 100644 (file)
index 0000000..b4881ca
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.cr;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Index;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+CREATE TABLE `cr_table_join` (
+        `src_table_name` varchar(30) NOT NULL,
+        `dest_table_name` varchar(30) NOT NULL,
+        `join_expr` varchar(500) NOT NULL,
+        KEY `cr_table_join_dest_table_name` (`dest_table_name`) USING BTREE,
+        KEY `cr_table_join_src_table_name` (`src_table_name`) USING BTREE,
+        CONSTRAINT `fk_cr_table_ref_311_cr_tab` FOREIGN KEY (`src_table_name`) REFERENCES `cr_table_source` (`table_name`),
+        CONSTRAINT `fk_cr_table_ref_315_cr_tab` FOREIGN KEY (`dest_table_name`) REFERENCES `cr_table_source` (`table_name`)
+        )
+*/
+
+
+@Table(name = "cr_table_join", indexes = {
+        @Index(name = "cr_table_join_dest_table_name", columnList = "dest_table_name"),
+        @Index(name = "cr_table_join_src_table_name", columnList = "src_table_name")
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class CrTableJoin {
+       //TODO Unique constrains {srcTableName, destTableName}?
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "id", nullable = false, columnDefinition = "int(11) auto_increment")
+       private Long id;
+       @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+       @JoinColumn(name = "src_table_name", nullable = false)
+       @Valid
+       @NotNull
+       private CrTableSource srcTableName;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "dest_table_name", nullable = false)
+       @Valid
+       @NotNull
+       private CrTableSource destTableName;
+       @Column(name = "join_expr", length = 500, nullable = false)
+       @Size(max = 500)
+       @SafeHtml
+       @NotNull
+       private String joinExpr;
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrTableRole.java b/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrTableRole.java
new file mode 100644 (file)
index 0000000..9487b97
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.cr;
+
+import java.io.Serializable;
+import java.math.BigInteger;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.validation.Valid;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.Positive;
+import lombok.AllArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.onap.portal.domain.db.cr.CrTableRole.CrTableRoleId;
+
+/*
+CREATE TABLE `cr_table_role` (
+        `table_name` varchar(30) NOT NULL,
+        `role_id` decimal(11,0) NOT NULL,
+        PRIMARY KEY (`table_name`,`role_id`),
+        CONSTRAINT `fk_cr_table_ref_32384_cr_table` FOREIGN KEY (`table_name`) REFERENCES `cr_table_source` (`table_name`)
+        )
+*/
+
+@Table(name = "cr_table_role")
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode
+@Getter
+@Setter
+@Entity
+@IdClass(CrTableRoleId.class)
+public class CrTableRole {
+       @Id
+       @Valid
+       @JoinColumn(name = "table_name", nullable = false)
+       @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+       private CrTableSource tableName;
+       @Id
+       @Digits(integer = 11, fraction = 0)
+       @Column(name = "role_id", nullable = false)
+       @Positive
+       private Long roleId;
+
+       @Getter
+       @Setter
+       @EqualsAndHashCode
+       @AllArgsConstructor
+       @NoArgsConstructor
+       public static class CrTableRoleId implements Serializable {
+              @Valid
+              private CrTableSource tableName;
+              @Digits(integer = 11, fraction = 0)
+              private BigInteger roleId;
+       }
+}
\ No newline at end of file
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrTableSource.java b/portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrTableSource.java
new file mode 100644 (file)
index 0000000..a98999b
--- /dev/null
@@ -0,0 +1,134 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.cr;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.Id;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+CREATE TABLE `cr_table_source` (
+        `table_name` varchar(30) NOT NULL,
+        `display_name` varchar(30) NOT NULL,
+        `pk_fields` varchar(200) DEFAULT NULL,
+        `web_view_action` varchar(50) DEFAULT NULL,
+        `large_data_source_yn` varchar(1) NOT NULL DEFAULT 'n',
+        `filter_sql` varchar(4000) DEFAULT NULL,
+        `source_db` varchar(50) DEFAULT NULL,
+        PRIMARY KEY (`table_name`)
+        )
+*/
+
+@Table(name = "cr_table_source")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class CrTableSource {
+       @Id
+       @Column(name = "table_name", length = 30, nullable = false)
+       @Size(max = 30)
+       @SafeHtml
+       private String tableName;
+       @Column(name = "display_name", length = 30, nullable = false)
+       @Size(max = 30)
+       @SafeHtml
+       @NotNull
+       private String displayName;
+       @Column(name = "pk_fields", length = 200)
+       @Size(max = 200)
+       @SafeHtml
+       private String pkFields;
+       @Column(name = "web_view_action", length = 50)
+       @Size(max = 50)
+       @SafeHtml
+       private String webViewAction;
+       @Column(name = "large_data_source_yn", length = 1, columnDefinition = "character varying(1) default 'n'", nullable = false)
+       @Pattern(regexp = "[YNyn]")
+       @Size(max = 1)
+       @SafeHtml
+       @NotNull
+       private String largeDataSourceYn;
+       @Column(name = "filter_sql", length = 4000)
+       @Size(max = 4000)
+       @SafeHtml
+       private String filterSql;
+       @Column(name = "source_db", length = 50)
+       @Size(max = 50)
+       @SafeHtml
+       private String sourceDb;
+       @OneToMany(
+               targetEntity = CrTableJoin.class,
+               mappedBy = "srcTableName",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<CrTableJoin> crTableJoins = new ArrayList<>();
+       @OneToMany(
+               targetEntity = CrTableJoin.class,
+               mappedBy = "destTableName",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<CrTableJoin> crTableJoins1 = new ArrayList<>();
+       @OneToMany(
+               targetEntity = CrTableRole.class,
+               mappedBy = "tableName",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<CrTableRole> crTableRoles = new ArrayList<>();
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpAppFunction.java b/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpAppFunction.java
new file mode 100644 (file)
index 0000000..cae3b3b
--- /dev/null
@@ -0,0 +1,127 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.ep;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.Index;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.onap.portal.domain.db.ep.EpAppFunction.EpAppFunctionId;
+import org.onap.portal.domain.db.fn.FnApp;
+
+/*
+CREATE TABLE `ep_app_function` (
+        `app_id` int(11) NOT NULL,
+        `function_cd` varchar(250) NOT NULL,
+        `function_name` varchar(250) NOT NULL,
+        PRIMARY KEY (`function_cd`,`app_id`),
+        KEY `fk_ep_app_function_app_id` (`app_id`),
+        CONSTRAINT `fk_ep_app_function_app_id` FOREIGN KEY (`app_id`) REFERENCES `fn_app` (`app_id`)
+        )
+*/
+
+@Table(name = "ep_app_function", indexes = {@Index(name = "fk_ep_app_function_app_id", columnList = "app_id")})
+@EqualsAndHashCode
+@Getter
+@Setter
+@Entity
+@IdClass(EpAppFunctionId.class)
+@NoArgsConstructor
+@AllArgsConstructor
+public class EpAppFunction {
+       @Id
+       @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+       @JoinColumn(name = "app_id")
+       @Valid
+       private FnApp appId;
+       @Id
+       @Column(name = "function_cd", length = 250, nullable = false)
+       @Size(max = 250)
+       @NotNull
+       @SafeHtml
+       private String functionCd;
+       @Column(name = "function_name", length = 250, nullable = false)
+       @Size(max = 250)
+       @NotNull
+       @SafeHtml
+       private String functionName;
+       @OneToMany(
+               targetEntity = EpAppRoleFunction.class,
+               mappedBy = "epAppFunction",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<EpAppRoleFunction> epAppRoleFunctions = new ArrayList<>();
+
+       @Getter
+       @Setter
+       @EqualsAndHashCode
+       @NoArgsConstructor
+       @AllArgsConstructor
+       public static class EpAppFunctionId implements Serializable {
+              @Valid
+              private FnApp appId;
+              @Size(max = 250)
+              @NotNull
+              @SafeHtml
+              private String functionCd;
+       }
+}
+
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpAppRoleFunction.java b/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpAppRoleFunction.java
new file mode 100644 (file)
index 0000000..c41c55f
--- /dev/null
@@ -0,0 +1,122 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.ep;
+
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Index;
+import javax.persistence.JoinColumn;
+import javax.persistence.JoinColumns;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.validation.Valid;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotNull;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.onap.portal.domain.db.fn.FnApp;
+import org.onap.portal.domain.db.fn.FnRole;
+
+/*
+CREATE TABLE `ep_app_role_function` (
+        `id` int(11) NOT NULL AUTO_INCREMENT,
+        `app_id` int(11) NOT NULL,
+        `role_id` int(11) NOT NULL,
+        `function_cd` varchar(250) NOT NULL,
+        `role_app_id` varchar(20) DEFAULT NULL,
+        PRIMARY KEY (`id`),
+        UNIQUE KEY `UNIQUE KEY` (`app_id`,`role_id`,`function_cd`),
+        KEY `fk_ep_app_role_function_ep_app_func` (`app_id`,`function_cd`),
+        KEY `fk_ep_app_role_function_role_id` (`role_id`),
+        CONSTRAINT `fk_ep_app_role_function_app_id` FOREIGN KEY (`app_id`) REFERENCES `fn_app` (`app_id`),
+        CONSTRAINT `fk_ep_app_role_function_ep_app_func` FOREIGN KEY (`app_id`, `function_cd`) REFERENCES `ep_app_function` (`app_id`, `function_cd`),
+        CONSTRAINT `fk_ep_app_role_function_role_id` FOREIGN KEY (`role_id`) REFERENCES `fn_role` (`role_id`)
+        )
+*/
+
+@Table(name = "ep_app_role_function", indexes = {
+        @Index(name = "fk_ep_app_role_function_ep_app_func_role_id", columnList = "app_id, role_id, function_cd", unique = true),
+        @Index(name = "fk_ep_app_role_function_ep_app_func", columnList = "app_id, function_cd"),
+        @Index(name = "fk_ep_app_role_function_role_id", columnList = "role_id")
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class EpAppRoleFunction {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "id", length = 11, nullable = false, columnDefinition = "int(11) NOT NULL AUTO_INCREMENT")
+       @Digits(integer = 11, fraction = 0)
+       private Integer id;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "app_id", insertable = false, updatable = false)
+       @Valid
+       @NotNull
+       private FnApp appId;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "role_id")
+       @Valid
+       @NotNull
+       private FnRole fnRole;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumns({
+               @JoinColumn(name = "app_id", referencedColumnName = "app_id"),
+               @JoinColumn(name = "function_cd", referencedColumnName = "function_cd")
+       })
+       @Valid
+       @NotNull
+       private EpAppFunction epAppFunction;
+       @Column(name = "role_app_id", length = 20)
+       @Digits(integer = 20, fraction = 0)
+       @SafeHtml
+       private String roleAppId;
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpBasicAuthAccount.java b/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpBasicAuthAccount.java
new file mode 100644 (file)
index 0000000..a8e0874
--- /dev/null
@@ -0,0 +1,114 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.ep;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+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;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+CREATE TABLE `ep_basic_auth_account` (
+        `id` int(11) NOT NULL AUTO_INCREMENT,
+        `ext_app_name` varchar(50) NOT NULL,
+        `username` varchar(50) NOT NULL,
+        `password` varchar(50) DEFAULT NULL,
+        `active_yn` char(1) NOT NULL DEFAULT 'Y',
+        PRIMARY KEY (`id`)
+        )
+*/
+
+@Table(name = "ep_basic_auth_account")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class EpBasicAuthAccount {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "id", length = 11, nullable = false, columnDefinition = "int(11) AUTO_INCREMENT")
+       @Digits(integer = 11, fraction = 0)
+       private Long id;
+       @Column(name = "ext_app_name", length = 50, nullable = false)
+       @Size(max = 50)
+       @SafeHtml
+       @NotNull
+       private String extAppName;
+       @Column(name = "username", length = 50, nullable = false)
+       @Size(max = 50)
+       @SafeHtml
+       @NotNull
+       private String username;
+       @Column(name = "password", length = 50)
+       @Size(max = 50)
+       @SafeHtml
+       private String password;
+       @Column(name = "active_yn", length = 1, nullable = false, columnDefinition = "char(1) NOT NULL default 'Y'")
+       @Pattern(regexp = "[YNyn]")
+       @Size(max = 1)
+       @NotNull
+       @SafeHtml
+       private String activeYn;
+       @OneToMany(
+               targetEntity = EpEndpointsBasicAuthAccount.class,
+               mappedBy = "accountId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<EpEndpointsBasicAuthAccount> epEndpointsBasicAuthAccounts = new ArrayList<>();
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpEndpoints.java b/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpEndpoints.java
new file mode 100644 (file)
index 0000000..5ab4cb9
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.ep;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotNull;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.hibernate.validator.constraints.URL;
+
+/*
+CREATE TABLE `ep_endpoints` (
+        `id` int(11) NOT NULL AUTO_INCREMENT,
+        `url` varchar(50) NOT NULL,
+        PRIMARY KEY (`id`)
+        )
+*/
+
+
+@Table(name = "ep_endpoints")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class EpEndpoints {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "id", length = 11, nullable = false, columnDefinition = "int(11) AUTO_INCREMENT")
+       @Digits(integer = 11, fraction = 0)
+       private Long id;
+       @Column(name = "url", length = 50, nullable = false)
+       @Digits(integer = 50, fraction = 0)
+       @NotNull
+       @SafeHtml
+       @NotNull
+       //TODO URL
+       @URL
+       private String url;
+       @OneToMany(
+               targetEntity = EpEndpointsBasicAuthAccount.class,
+               mappedBy = "epId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<EpEndpointsBasicAuthAccount> epEndpointsBasicAuthAccounts = new ArrayList<>();
+
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpEndpointsBasicAuthAccount.java b/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpEndpointsBasicAuthAccount.java
new file mode 100644 (file)
index 0000000..6341186
--- /dev/null
@@ -0,0 +1,109 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.ep;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Index;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.Table;
+import javax.validation.Valid;
+import javax.validation.constraints.Digits;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+/*
+CREATE TABLE `ep_endpoints_basic_auth_account` (
+        `id` int(11) NOT NULL AUTO_INCREMENT,
+        `ep_id` int(11) DEFAULT NULL,
+        `account_id` int(11) DEFAULT NULL,
+        PRIMARY KEY (`id`),
+        KEY `ep_endpoints_basic_auth_account_account_id_fk` (`account_id`),
+        KEY `ep_endpoints_basic_auth_account_ep_id_fk` (`ep_id`),
+        CONSTRAINT `ep_endpoints_basic_auth_account_account_id_fk` FOREIGN KEY (`account_id`) REFERENCES `ep_basic_auth_account` (`id`),
+        CONSTRAINT `ep_endpoints_basic_auth_account_ep_id_fk` FOREIGN KEY (`ep_id`) REFERENCES `ep_endpoints` (`id`)
+        )
+*/
+
+@NamedQueries({
+        @NamedQuery(
+                name = "EpEndpointsBasicAuthAccount.deleteByAccountId",
+                query = "FROM EpEndpointsBasicAuthAccount WHERE account_id = :accountId"),
+        @NamedQuery(
+                name = "EpEndpointsBasicAuthAccount.deleteByAccountIdAndEpId",
+                query = "FROM EpEndpointsBasicAuthAccount WHERE account_id =:accountId AND ep_id =:epId")
+
+})
+
+@Table(name = "ep_endpoints_basic_auth_account", indexes = {
+        @Index(name = "ep_endpoints_basic_auth_account_account_id_fk", columnList = "account_id"),
+        @Index(name = "ep_endpoints_basic_auth_account_ep_id_fk", columnList = "ep_id")
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class EpEndpointsBasicAuthAccount {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "id", length = 11, nullable = false, columnDefinition = "int(11) AUTO_INCREMENT")
+       @Digits(integer = 11, fraction = 0)
+       private Long id;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "ep_id", columnDefinition = "INT(11) DEFAULT NULL")
+       @Valid
+       private EpEndpoints epId;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "account_id", columnDefinition = "INT(11) DEFAULT NULL")
+       @Valid
+       private EpBasicAuthAccount accountId;
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpMicroservice.java b/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpMicroservice.java
new file mode 100644 (file)
index 0000000..35e51be
--- /dev/null
@@ -0,0 +1,161 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.ep;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Index;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToMany;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.validation.Valid;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.Pattern;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import lombok.ToString;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.hibernate.validator.constraints.URL;
+import org.onap.portal.domain.db.fn.FnApp;
+
+/*
+CREATE TABLE `ep_microservice` (
+        `id` int(11) NOT NULL AUTO_INCREMENT,
+        `name` varchar(50) DEFAULT NULL,
+        `description` varchar(50) DEFAULT NULL,
+        `appId` int(11) DEFAULT NULL,
+        `endpoint_url` varchar(200) DEFAULT NULL,
+        `security_type` varchar(50) DEFAULT NULL,
+        `username` varchar(50) DEFAULT NULL,
+        `password` varchar(50) NOT NULL,
+        `active` char(1) NOT NULL DEFAULT 'Y',
+        PRIMARY KEY (`id`),
+        KEY `FK_FN_APP_EP_MICROSERVICE` (`appId`),
+        CONSTRAINT `FK_FN_APP_EP_MICROSERVICE` FOREIGN KEY (`appId`) REFERENCES `fn_app` (`app_id`)
+        )
+*/
+
+@Table(name = "ep_microservice", indexes = {
+        @Index(name = "FK_FN_APP_EP_MICROSERVICE", columnList = "app_Id")
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@ToString
+@Getter
+@Setter
+@Entity
+public class EpMicroservice {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "id", length = 11, nullable = false)
+       @Digits(integer = 11, fraction = 0)
+       private Long id;
+       @Column(name = "name", length = 50)
+       @Size(max = 50)
+       @SafeHtml
+       private String name;
+       @Column(name = "description", length = 50)
+       @Size(max = 50)
+       @SafeHtml
+       private String description;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "app_Id")
+       @Valid
+       private FnApp appId;
+       @Column(name = "endpoint_url", length = 200)
+       @Size(max = 200)
+       @SafeHtml
+       //TODO URL
+       @URL
+       private String endpointUrl;
+       @Column(name = "security_type", length = 50)
+       @Size(max = 50)
+       @SafeHtml
+       private String securityType;
+       @Column(name = "username", length = 50)
+       @Size(max = 50)
+       @SafeHtml
+       private String username;
+       @Column(name = "password", length = 50, nullable = false)
+       @Size(max = 50)
+       @SafeHtml
+       private String password;
+       @Column(name = "active", length = 1, columnDefinition = "CHAR(1) DEFAULT 'Y'")
+       @Pattern(regexp = "[YNyn]")
+       @Size(max = 1)
+       @SafeHtml
+       private String active;
+       @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+       private List<EpWidgetCatalog> epWidgetCatalogList = new ArrayList<>();
+       @OneToMany(
+               targetEntity = EpMicroserviceParameter.class,
+               mappedBy = "serviceId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<EpMicroserviceParameter> epMicroserviceParameters = new ArrayList<>();
+
+       public void copyOf(final EpMicroservice epMicroservice) {
+              this.id = epMicroservice.getId();
+              this.name = epMicroservice.getName();
+              this.description = epMicroservice.getDescription();
+              this.appId = epMicroservice.getAppId();
+              this.endpointUrl = epMicroservice.getEndpointUrl();
+              this.securityType = epMicroservice.getSecurityType();
+              this.username = epMicroservice.getUsername();
+              this.password = epMicroservice.getPassword();
+              this.active = epMicroservice.getActive();
+              this.epWidgetCatalogList = epMicroservice.getEpWidgetCatalogList();
+              this.epMicroserviceParameters = epMicroservice.getEpMicroserviceParameters();
+       }
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpMicroserviceParameter.java b/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpMicroserviceParameter.java
new file mode 100644 (file)
index 0000000..51ca6f2
--- /dev/null
@@ -0,0 +1,121 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.ep;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Index;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import lombok.ToString;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+CREATE TABLE `ep_microservice_parameter` (
+        `id` int(11) NOT NULL AUTO_INCREMENT,
+        `service_id` int(11) DEFAULT NULL,
+        `para_key` varchar(50) DEFAULT NULL,
+        `para_value` varchar(50) DEFAULT NULL,
+        PRIMARY KEY (`id`),
+        KEY `FK_EP_MICROSERIVCE_EP_MICROSERVICE_PARAMETER` (`service_id`),
+        CONSTRAINT `FK_EP_MICROSERIVCE_EP_MICROSERVICE_PARAMETER` FOREIGN KEY (`service_id`) REFERENCES `ep_microservice` (`id`)
+        )
+*/
+
+@NamedQueries({
+        @NamedQuery(
+                name = "EpMicroserviceParameter.deleteByServiceId",
+                query = "FROM EpMicroserviceParameter WHERE service_id =:serviceId")
+})
+
+@Table(name = "ep_microservice_parameter", indexes = {
+        @Index(name = "FK_EP_MICROSERIVCE_EP_MICROSERVICE_PARAMETER", columnList = "service_id")
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@ToString
+@Getter
+@Setter
+@Entity
+public class EpMicroserviceParameter {
+
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "id", length = 11, nullable = false)
+       @Digits(integer = 11, fraction = 0)
+       private Long id;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "service_id")
+       private EpMicroservice serviceId;
+       @Column(name = "para_key", length = 50)
+       @Size(max = 50)
+       @SafeHtml
+       private String paraKey;
+       @Column(name = "para_value", length = 50)
+       @Size(max = 50)
+       @SafeHtml
+       private String paraValue;
+       @OneToMany(
+               targetEntity = EpWidgetCatalogParameter.class,
+               mappedBy = "paramId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<EpWidgetCatalogParameter> epWidgetCatalogParameters = new ArrayList<>();
+
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpMlModel.java b/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpMlModel.java
new file mode 100644 (file)
index 0000000..270c992
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.ep;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.Table;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.PastOrPresent;
+import lombok.AllArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.onap.portal.domain.db.ep.EpMlModel.EpMlModelId;
+
+/*
+CREATE TABLE `ep_ml_model` (
+        `time_stamp` timestamp NOT NULL DEFAULT current_timestamp(),
+        `group_id` int(11) NOT NULL,
+        `model` longblob DEFAULT NULL,
+        PRIMARY KEY (`time_stamp`,`group_id`)
+        )
+*/
+
+@Table(name = "ep_ml_model")
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode
+@Getter
+@Setter
+@Entity
+@IdClass(EpMlModelId.class)
+public class EpMlModel {
+       @Id
+       @Digits(integer = 11, fraction = 0)
+       @Column(name = "group_id", length = 11, nullable = false)
+       @NotNull
+       private Long groupId;
+       @Id
+       @PastOrPresent
+       @Column(name = "time_stamp", nullable = false, columnDefinition = "datetime DEFAULT current_timestamp()")
+       private LocalDateTime timeStamp;
+       @Column(name = "model", columnDefinition = "longblob DEFAULT NULL")
+       private byte[] model;
+
+       @Getter
+       @Setter
+       @NoArgsConstructor
+       @EqualsAndHashCode
+       @AllArgsConstructor
+       public static class EpMlModelId implements Serializable {
+              @Digits(integer = 11, fraction = 0)
+              private Long groupId;
+              @PastOrPresent
+              private LocalDateTime timeStamp;
+       }
+}
\ No newline at end of file
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpMlRec.java b/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpMlRec.java
new file mode 100644 (file)
index 0000000..2ed3f13
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.ep;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.Table;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.PastOrPresent;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.onap.portal.domain.db.ep.EpMlRec.EpMlRecId;
+
+/*
+CREATE TABLE `ep_ml_rec` (
+        `time_stamp` timestamp NOT NULL DEFAULT current_timestamp(),
+        `org_user_id` varchar(20) NOT NULL,
+        `rec` varchar(4000) DEFAULT NULL,
+        PRIMARY KEY (`time_stamp`,`org_user_id`)
+        )
+*/
+
+@Table(name = "ep_ml_rec")
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode
+@Getter
+@Setter
+@Entity
+@IdClass(EpMlRecId.class)
+public class EpMlRec {
+       @Id
+       @Column(name = "time_stamp", nullable = false, columnDefinition = "datetime DEFAULT current_timestamp()")
+       private LocalDateTime timeStamp;
+       @Id
+       @Column(name = "org_user_id", length = 20, nullable = false)
+       @Size(max = 20)
+       @NotNull
+       @SafeHtml
+       private String orgUserId;
+       @Column(name = "rec", length = 4000)
+       @Size(max = 4000)
+       @SafeHtml
+       private String rec;
+
+       @Getter
+       @Setter
+       @NoArgsConstructor
+       @EqualsAndHashCode
+       @AllArgsConstructor
+       public static class EpMlRecId implements Serializable {
+              private LocalDateTime timeStamp;
+              @Size(max = 20)
+              @NotNull
+              @SafeHtml
+              private String orgUserId;
+       }
+}
\ No newline at end of file
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpMlUser.java b/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpMlUser.java
new file mode 100644 (file)
index 0000000..0f17d25
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.ep;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.Table;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.PastOrPresent;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.onap.portal.domain.db.ep.EpMlUser.EpMlUserId;
+
+/*
+
+CREATE TABLE `ep_ml_user` (
+        `time_stamp` timestamp NOT NULL DEFAULT current_timestamp(),
+        `org_user_id` varchar(20) NOT NULL,
+        `group_id` int(11) NOT NULL,
+        PRIMARY KEY (`time_stamp`,`org_user_id`)
+        )
+*/
+
+@Table(name = "ep_ml_user")
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode
+@Getter
+@Setter
+@Entity
+@IdClass(EpMlUserId.class)
+public class EpMlUser {
+       @Id
+       @Column(name = "time_stamp", nullable = false, columnDefinition = "datetime DEFAULT current_timestamp()")
+       private LocalDateTime timeStamp;
+       @Id
+       @Column(name = "org_user_id", length = 20, nullable = false)
+       @Size(max = 20)
+       @NotNull
+       @SafeHtml
+       private String orgUserId;
+       @Column(name = "group_id", length = 11, nullable = false)
+       @Digits(integer = 11, fraction = 0)
+       @NotNull
+       @SafeHtml
+       private String group_id;
+
+       @Getter
+       @Setter
+       @NoArgsConstructor
+       @EqualsAndHashCode
+       @AllArgsConstructor
+       public static class EpMlUserId implements Serializable {
+              private LocalDateTime timeStamp;
+              @Size(max = 20)
+              @NotNull
+              @SafeHtml
+              private String orgUserId;
+       }
+}
\ No newline at end of file
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpNotification.java b/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpNotification.java
new file mode 100644 (file)
index 0000000..ab1bf73
--- /dev/null
@@ -0,0 +1,159 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.ep;
+
+import java.time.LocalDateTime;
+import java.util.ArrayList;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.FutureOrPresent;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.PastOrPresent;
+import javax.validation.constraints.Pattern;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+CREATE TABLE `ep_notification` (
+        `notification_ID` int(11) NOT NULL AUTO_INCREMENT,
+        `is_for_online_users` char(1) DEFAULT 'N',
+        `is_for_all_roles` char(1) DEFAULT 'N',
+        `active_YN` char(1) DEFAULT 'Y',
+        `msg_header` varchar(100) DEFAULT NULL,
+        `msg_description` varchar(2000) DEFAULT NULL,
+        `msg_source` varchar(50) DEFAULT 'EP',
+        `start_time` timestamp NOT NULL DEFAULT current_timestamp(),
+        `end_time` timestamp NULL DEFAULT NULL,
+        `priority` int(11) DEFAULT NULL,
+        `creator_ID` int(11) DEFAULT NULL,
+        `created_date` timestamp NULL DEFAULT NULL,
+        `notification_hyperlink` varchar(512) DEFAULT NULL,
+        PRIMARY KEY (`notification_ID`)
+        )
+*/
+
+@Table(name = "ep_notification")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class EpNotification {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "notification_ID", length = 11, nullable = false, columnDefinition = "int(11) AUTO_INCREMENT")
+       @Digits(integer = 11, fraction = 0)
+       private Long notificationID;
+       @Column(name = "is_for_online_users", length = 1, columnDefinition = "char(1) default 'N'")
+       @Pattern(regexp = "[YNyn]")
+       @Size(max = 1)
+       @SafeHtml
+       private String isForOnlineUsers;
+       @Column(name = "is_for_all_roles", length = 1, columnDefinition = "char(1) default 'N'")
+       @Pattern(regexp = "[YNyn]")
+       @Size(max = 1)
+       @SafeHtml
+       private String isForAllRoles;
+       @Column(name = "active_yn", length = 1, columnDefinition = "char(1) default 'Y'")
+       @Pattern(regexp = "[YNyn]")
+       @Size(max = 1)
+       @SafeHtml
+       private String activeYn;
+       @Column(name = "msg_header", length = 100)
+       @Size(max = 100)
+       @SafeHtml
+       private String msgHeader;
+       @Column(name = "msg_description", length = 2000)
+       @Size(max = 2000)
+       @SafeHtml
+       private String msgDescription;
+       @Column(name = "msg_source", length = 50, columnDefinition = "varchar(50) default 'EP'")
+       @Size(max = 50)
+       @SafeHtml
+       private String msgSource;
+       @Column(name = "start_time", nullable = false, columnDefinition = "datetime default now()")
+       @PastOrPresent
+       @NotNull
+       private LocalDateTime startTime;
+       @Column(name = "end_time")
+       @FutureOrPresent
+       private LocalDateTime end_time;
+       @Column(name = "priority", length = 11)
+       @Digits(integer = 11, fraction = 0)
+       private Long priority;
+       @Column(name = "creator_ID", length = 11)
+       @Digits(integer = 11, fraction = 0)
+       private Long creatorID;
+       @Column(name = "created_date")
+       @FutureOrPresent
+       private LocalDateTime createdDate;
+       @Column(name = "notification_hyperlink", length = 512)
+       @Size(max = 512)
+       @SafeHtml
+       private String notificationHyperlink;
+       @OneToMany(
+               targetEntity = EpRoleNotification.class,
+               mappedBy = "notificationID",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<EpRoleNotification> epRoleNotifications = new ArrayList<>();
+       @OneToMany(
+               targetEntity = EpUserNotification.class,
+               mappedBy = "notificationId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<EpUserNotification> epUserNotifications = new ArrayList<>();
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpPersUserAppSort.java b/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpPersUserAppSort.java
new file mode 100644 (file)
index 0000000..5f6e979
--- /dev/null
@@ -0,0 +1,109 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.ep;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Index;
+import javax.persistence.JoinColumn;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.OneToOne;
+import javax.persistence.Table;
+import javax.validation.Valid;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.onap.portal.domain.db.fn.FnUser;
+
+/*
+CREATE TABLE `ep_pers_user_app_sort` (
+        `id` int(11) NOT NULL AUTO_INCREMENT,
+        `user_id` int(11) NOT NULL,
+        `sort_pref` char(1) NOT NULL,
+        PRIMARY KEY (`id`),
+        UNIQUE KEY `uk_1_ep_pers_user_app_sort` (`user_id`),
+        CONSTRAINT `fk_ep_pers_user_app_sort_fn_user` FOREIGN KEY (`user_id`) REFERENCES `fn_user` (`user_id`)
+        )
+*/
+
+@NamedQueries({
+        @NamedQuery(
+                name = "EpPersUserAppSort.retrieveByUserId",
+                query = "from EpPersUserAppSort where user_id = :userId"
+        )
+})
+
+@Table(name = "ep_pers_user_app_sort", indexes = {
+        @Index(name = "uk_1_ep_pers_user_app_sort", columnList = "user_id", unique = true)
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class EpPersUserAppSort {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "id", length = 11, nullable = false, columnDefinition = "int(11) AUTO_INCREMENT")
+       @Digits(integer = 11, fraction = 0)
+       private Long id;
+       @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "user_id", unique = true, nullable = false)
+       @NotNull
+       @Valid
+       private FnUser userID;
+       @Column(name = "sort_pref", length = 1, nullable = false)
+       @Size(max = 1)
+       @NotNull
+       @SafeHtml
+       private String sortPref;
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpPersUserWidgetPlacement.java b/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpPersUserWidgetPlacement.java
new file mode 100644 (file)
index 0000000..060ca42
--- /dev/null
@@ -0,0 +1,128 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.ep;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Index;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.Table;
+import javax.validation.Valid;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotNull;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.onap.portal.domain.db.fn.FnUser;
+
+/*
+CREATE TABLE `ep_pers_user_widget_placement` (
+        `id` int(11) NOT NULL AUTO_INCREMENT,
+        `user_id` int(11) NOT NULL,
+        `widget_id` int(11) NOT NULL,
+        `x` int(11) NOT NULL,
+        `y` int(11) DEFAULT NULL,
+        `height` int(11) DEFAULT NULL,
+        `width` int(11) DEFAULT NULL,
+        PRIMARY KEY (`id`),
+        UNIQUE KEY `uk_1_ep_pers_user_widg_place` (`user_id`,`widget_id`),
+        KEY `fk_ep_pers_user_widg_place_ep_widg` (`widget_id`),
+        CONSTRAINT `fk_ep_pers_user_widg_place_ep_widg` FOREIGN KEY (`widget_id`) REFERENCES `ep_widget_catalog` (`widget_id`),
+        CONSTRAINT `fk_ep_pers_user_widg_place_fn_user` FOREIGN KEY (`user_id`) REFERENCES `fn_user` (`user_id`)
+        )
+*/
+
+@NamedQueries({
+        @NamedQuery(
+                name = "EpPersUserWidgetPlacement.retrieveByUserId",
+                query = "from EpPersUserWidgetPlacement where USER_ID =:userId"
+        )
+})
+
+@Table(name = "ep_pers_user_widget_placement", indexes = {
+        @Index(name = "uk_1_ep_pers_user_widg_sel_user_widg", columnList = "user_id, widget_id", unique = true),
+        @Index(name = "fk_2_ep_pers_user_wid_sel_ep_wid", columnList = "widget_id")
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class EpPersUserWidgetPlacement {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "id", length = 11, nullable = false, columnDefinition = "int(11) AUTO_INCREMENT")
+       @Digits(integer = 11, fraction = 0)
+       private Long id;
+       @ManyToOne(fetch = FetchType.LAZY,cascade = CascadeType.ALL)
+       @JoinColumn(name = "user_id", nullable = false)
+       @NotNull
+       @Valid
+       private FnUser userId;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "widget_id", nullable = false)
+       @NotNull
+       @Valid
+       private EpWidgetCatalog widgetId;
+       @Column(name = "x", length = 11, nullable = false)
+       @Digits(integer = 11, fraction = 0)
+       @NotNull
+       private Long x;
+       @Column(name = "y", length = 11, nullable = false)
+       @Digits(integer = 11, fraction = 0)
+       @NotNull
+       private Long y;
+       @Column(name = "height", length = 11)
+       @Digits(integer = 11, fraction = 0)
+       private Long height;
+       @Column(name = "width", length = 11)
+       @Digits(integer = 11, fraction = 0)
+       private Long width;
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpPersUserWidgetSel.java b/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpPersUserWidgetSel.java
new file mode 100644 (file)
index 0000000..6c439c8
--- /dev/null
@@ -0,0 +1,109 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.ep;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.persistence.UniqueConstraint;
+import javax.validation.Valid;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.onap.portal.domain.db.fn.FnUser;
+
+/*
+CREATE TABLE `ep_pers_user_widget_sel` (
+        `id` int(11) NOT NULL AUTO_INCREMENT,
+        `user_id` int(11) NOT NULL,
+        `widget_id` int(11) NOT NULL,
+        `status_cd` char(1) NOT NULL,
+        PRIMARY KEY (`id`),
+        UNIQUE KEY `uk_1_ep_pers_user_widg_sel_user_widg` (`user_id`,`widget_id`),
+        KEY `fk_2_ep_pers_user_wid_sel_ep_wid` (`widget_id`),
+        CONSTRAINT `fk_1_ep_pers_user_wid_sel_fn_user` FOREIGN KEY (`user_id`) REFERENCES `fn_user` (`user_id`),
+        CONSTRAINT `fk_2_ep_pers_user_wid_sel_ep_wid` FOREIGN KEY (`widget_id`) REFERENCES `ep_widget_catalog` (`widget_id`)
+        )
+*/
+
+@Table(name = "ep_pers_user_widget_sel", uniqueConstraints = {
+        @UniqueConstraint(columnNames = {"user_id", "widget_id"})
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class EpPersUserWidgetSel {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "id", length = 11, nullable = false)
+       @Digits(integer = 11, fraction = 0)
+       private Long id;
+       @ManyToOne(fetch = FetchType.LAZY,cascade = CascadeType.ALL)
+       @JoinColumn(name = "user_id", nullable = false)
+       @NotNull
+       @Valid
+       private FnUser userId;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "widget_id", nullable = false)
+       @NotNull
+       @Valid
+       private EpWidgetCatalog widgetId;
+       @Column(name = "status_cd", length = 1, nullable = false)
+       @Size(max = 1)
+       @NotNull
+       @SafeHtml
+       private String statusCd;
+
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpRoleNotification.java b/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpRoleNotification.java
new file mode 100644 (file)
index 0000000..80f8676
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.ep;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Index;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.validation.Valid;
+import javax.validation.constraints.Digits;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.onap.portal.domain.db.fn.FnRole;
+
+/*
+CREATE TABLE `ep_role_notification` (
+        `ID` int(11) NOT NULL AUTO_INCREMENT,
+        `notification_ID` int(11) DEFAULT NULL,
+        `role_ID` int(11) DEFAULT NULL,
+        `recv_user_id` int(11) DEFAULT NULL,
+        PRIMARY KEY (`ID`),
+        KEY `fk_ep_role_notif_fn_role` (`role_ID`),
+        KEY `fk_ep_role_notif_fn_notif` (`notification_ID`),
+        KEY `ep_notif_recv_user_id_idx` (`recv_user_id`) USING BTREE,
+        CONSTRAINT `fk_ep_role_notif_fn_notif` FOREIGN KEY (`notification_ID`) REFERENCES `ep_notification` (`notification_ID`),
+        CONSTRAINT `fk_ep_role_notif_fn_role` FOREIGN KEY (`role_ID`) REFERENCES `fn_role` (`role_id`)
+        )
+*/
+
+@Table(name = "ep_role_notification", indexes = {
+        @Index(name = "ep_notif_recv_user_id_idx", columnList = "recv_user_id"),
+        @Index(name = "fk_ep_role_notif_fn_notif", columnList = "notification_ID"),
+        @Index(name = "fk_ep_role_notif_fn_role", columnList = "role_ID")
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class EpRoleNotification {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "ID", length = 11, nullable = false, columnDefinition = "int(11) AUTO_INCREMENT")
+       @Digits(integer = 11, fraction = 0)
+       private Long id;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "notification_ID")
+       @Valid
+       private EpNotification notificationID;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "role_ID")
+       @Valid
+       private FnRole roleID;
+       @Column(name = "recv_user_id", length = 11, columnDefinition = "int(11) DEFAULT NULL")
+       @Digits(integer = 11, fraction = 0)
+       private Long recvUserId;
+
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpUserNotification.java b/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpUserNotification.java
new file mode 100644 (file)
index 0000000..47e195a
--- /dev/null
@@ -0,0 +1,114 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.ep;
+
+import java.time.LocalDateTime;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Index;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.validation.Valid;
+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;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.onap.portal.domain.db.fn.FnUser;
+
+/*
+CREATE TABLE `ep_user_notification` (
+        `ID` int(11) NOT NULL AUTO_INCREMENT,
+        `User_ID` int(11) DEFAULT NULL,
+        `notification_ID` int(11) DEFAULT NULL,
+        `is_viewed` char(1) DEFAULT 'N',
+        `updated_time` timestamp NOT NULL DEFAULT current_timestamp(),
+        PRIMARY KEY (`ID`),
+        KEY `fk_ep_urole_notif_fn_user` (`User_ID`),
+        KEY `fk_ep_urole_notif_fn_notif` (`notification_ID`),
+        CONSTRAINT `fk_ep_urole_notif_fn_notif` FOREIGN KEY (`notification_ID`) REFERENCES `ep_notification` (`notification_ID`),
+        CONSTRAINT `fk_ep_urole_notif_fn_user` FOREIGN KEY (`User_ID`) REFERENCES `fn_user` (`user_id`)
+        )
+*/
+
+@Table(name = "ep_user_notification", indexes = {
+        @Index(name = "fk_ep_urole_notif_fn_user", columnList = "User_ID"),
+        @Index(name = "fk_ep_urole_notif_fn_notif", columnList = "notification_ID")
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class EpUserNotification {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "ID", length = 11, nullable = false, columnDefinition = "int(11) AUTO_INCREMENT")
+       @Digits(integer = 11, fraction = 0)
+       private Integer id;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "User_ID")
+       @Valid
+       private FnUser userId;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "notification_ID")
+       @Valid
+       private EpNotification notificationId;
+       @Column(name = "is_viewed", length = 1, columnDefinition = "char(1) default 'N'")
+       @Pattern(regexp = "[YNyn]")
+       @Size(max = 1)
+       @SafeHtml
+       private String isViewed;
+       @Column(name = "updated_time", nullable = false, columnDefinition = "datetime default now()")
+       @NotNull
+       private LocalDateTime updatedTime;
+
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpUserRolesRequest.java b/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpUserRolesRequest.java
new file mode 100644 (file)
index 0000000..0d8bfc8
--- /dev/null
@@ -0,0 +1,126 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.ep;
+
+import java.time.LocalDateTime;
+import java.util.ArrayList;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.validation.Valid;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.PastOrPresent;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.onap.portal.domain.db.fn.FnApp;
+import org.onap.portal.domain.db.fn.FnUser;
+
+/*
+CREATE TABLE `ep_user_roles_request` (
+        `req_id` int(11) NOT NULL AUTO_INCREMENT,
+        `user_id` int(11) NOT NULL,
+        `app_id` int(11) NOT NULL,
+        `created_date` timestamp NOT NULL DEFAULT current_timestamp(),
+        `updated_date` timestamp NOT NULL DEFAULT current_timestamp(),
+        `request_status` varchar(50) NOT NULL,
+        PRIMARY KEY (`req_id`),
+        KEY `fk_user_roles_req_fn_user` (`user_id`),
+        KEY `fk_user_roles_req_fn_app` (`app_id`),
+        CONSTRAINT `fk_user_roles_req_fn_app` FOREIGN KEY (`app_id`) REFERENCES `fn_app` (`app_id`),
+        CONSTRAINT `fk_user_roles_req_fn_user` FOREIGN KEY (`user_id`) REFERENCES `fn_user` (`user_id`)
+        )
+*/
+
+@Table(name = "ep_user_roles_request")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class EpUserRolesRequest {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "req_id", length = 11, nullable = false, columnDefinition = "int(11) AUTO_INCREMENT")
+       @Digits(integer = 11, fraction = 0)
+       private Long reqId;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "user_id", nullable = false)
+       @NotNull
+       @Valid
+       private FnUser userId;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "app_id", nullable = false)
+       @NotNull
+       @Valid
+       private FnApp appId;
+       @Column(name = "created_date", nullable = false, columnDefinition = "datetime default now()")
+       @PastOrPresent
+       private LocalDateTime createdDate;
+       @Column(name = "updated_date", nullable = false, columnDefinition = "datetime default now()")
+       @PastOrPresent
+       private LocalDateTime updatedDate;
+       @Column(name = "request_status", nullable = false, length = 50)
+       @Size(max = 50)
+       @NotNull
+       @SafeHtml
+       private String requestStatus;
+       @OneToMany(
+               targetEntity = EpUserRolesRequestDet.class,
+               mappedBy = "reqId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<EpUserRolesRequestDet> epUserRolesRequestDets = new ArrayList<>();
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpUserRolesRequestDet.java b/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpUserRolesRequestDet.java
new file mode 100644 (file)
index 0000000..1b27ee7
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.ep;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Index;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToOne;
+import javax.persistence.Table;
+import javax.validation.Valid;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.onap.portal.domain.db.fn.FnRole;
+
+/*
+CREATE TABLE `ep_user_roles_request_det` (
+        `id` int(11) NOT NULL AUTO_INCREMENT,
+        `req_id` int(11) DEFAULT NULL,
+        `requested_role_id` int(10) NOT NULL,
+        `request_type` varchar(10) NOT NULL,
+        PRIMARY KEY (`id`),
+        KEY `fk_user_roles_req_fn_req_id` (`req_id`),
+        KEY `fk_user_roles_req_fn_role_id` (`requested_role_id`),
+        CONSTRAINT `fk_user_roles_req_fn_req_id` FOREIGN KEY (`req_id`) REFERENCES `ep_user_roles_request` (`req_id`),
+        CONSTRAINT `fk_user_roles_req_fn_role_id` FOREIGN KEY (`requested_role_id`) REFERENCES `fn_role` (`role_id`)
+        )
+*/
+
+@Table(name = "ep_user_roles_request_det", indexes = {
+        @Index(name = "fk_user_roles_req_fn_req_id", columnList = "req_id"),
+        @Index(name = "fk_user_roles_req_fn_role_id", columnList = "requested_role_id")
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class EpUserRolesRequestDet {
+
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "id", length = 11, nullable = false, columnDefinition = "int(11) AUTO_INCREMENT")
+       @Digits(integer = 11, fraction = 0)
+       private Long id;
+       @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "req_id", columnDefinition = "int(11) default null")
+       @Valid
+       private EpUserRolesRequest reqId;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "requested_role_id", nullable = false)
+       @NotNull
+       @Valid
+       private FnRole requestedRoleId;
+       @Column(name = "request_type", length = 10, nullable = false)
+       @Size(max = 10)
+       @NotNull
+       @SafeHtml
+       private String requestType;
+
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpWebAnalyticsSource.java b/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpWebAnalyticsSource.java
new file mode 100644 (file)
index 0000000..1a15518
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.ep;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Index;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.validation.Valid;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.onap.portal.domain.db.fn.FnApp;
+
+/*
+CREATE TABLE `ep_web_analytics_source` (
+        `resource_id` int(11) NOT NULL AUTO_INCREMENT,
+        `app_id` int(11) NOT NULL,
+        `report_source` varchar(500) DEFAULT NULL,
+        `report_name` varchar(500) DEFAULT NULL,
+        PRIMARY KEY (`resource_id`),
+        KEY `app_id` (`app_id`),
+        CONSTRAINT `ep_web_analytics_source_ibfk_1` FOREIGN KEY (`app_id`) REFERENCES `fn_app` (`app_id`)
+        )
+*/
+
+@Table(name = "ep_web_analytics_source", indexes = {
+        @Index(name = "app_id", columnList = "app_id")
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class EpWebAnalyticsSource {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "resource_id", length = 11, nullable = false, columnDefinition = "int(11) AUTO_INCREMENT")
+       @Digits(integer = 11, fraction = 0)
+       private Integer resourceId;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "app_id", nullable = false)
+       @NotNull
+       @Valid
+       private FnApp appId;
+       @Column(name = "report_source", length = 500)
+       @Size(max = 500)
+       @SafeHtml
+       private String reportSource;
+       @Column(name = "report_name", length = 500)
+       @Size(max = 500)
+       @SafeHtml
+       private String reportName;
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpWidgetCatalog.java b/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpWidgetCatalog.java
new file mode 100644 (file)
index 0000000..260483f
--- /dev/null
@@ -0,0 +1,161 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.ep;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Index;
+import javax.persistence.JoinColumn;
+import javax.persistence.JoinTable;
+import javax.persistence.ManyToMany;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+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;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+CREATE TABLE `ep_widget_catalog` (
+        `widget_id` int(11) NOT NULL AUTO_INCREMENT,
+        `wdg_name` varchar(100) NOT NULL DEFAULT '?',
+        `service_id` int(11) DEFAULT NULL,
+        `wdg_desc` varchar(200) DEFAULT NULL,
+        `wdg_file_loc` varchar(256) NOT NULL DEFAULT '?',
+        `all_user_flag` char(1) NOT NULL DEFAULT 'N',
+        PRIMARY KEY (`widget_id`)
+        )
+*/
+
+@Table(name = "ep_widget_catalog")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class EpWidgetCatalog {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "widget_id", length = 11, nullable = false, columnDefinition = "int(11) AUTO_INCREMENT")
+       @Digits(integer = 11, fraction = 0)
+       private Long widgetId;
+       @Column(name = "wdg_name", length = 100, columnDefinition = "varchar(100) default '?'", nullable = false)
+       @Size(max = 100)
+       @NotNull
+       @SafeHtml
+       private String wdgName;
+       @Column(name = "service_id", length = 11)
+       @Digits(integer = 11, fraction = 0)
+       private Long serviceId;
+       @Column(name = "wdg_desc", length = 200)
+       @Size(max = 200)
+       @SafeHtml
+       private String wdgDesc;
+       @Column(name = "wdg_file_loc", length = 256, nullable = false, columnDefinition = "varchar(256) not null default '?'")
+       @Size(max = 256)
+       @NotNull
+       @SafeHtml
+       private String wdgFileLoc;
+       @Column(name = "all_user_flag", length = 1, columnDefinition = "char(1) not null default 'N'", nullable = false)
+       @Pattern(regexp = "[YNyn]")
+       @Size(max = 1)
+       @SafeHtml
+       @NotNull
+       private String allUserFlag;
+       @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+       @JoinTable(
+               name = "ep_widget_microservice",
+               joinColumns = {@JoinColumn(name = "widget_id", referencedColumnName = "widget_id")},
+               inverseJoinColumns = {@JoinColumn(name = "microservice_id", referencedColumnName = "id")},
+               indexes = {
+                       @Index(name = "FK_EP_WIDGET_MICROSERVICE_EP_MICROSERVICE", columnList = "microservice_id"),
+                       @Index(name = "FK_EP_WIDGET_MICROSERVICE_EP_WIDGET", columnList = "widget_id")
+               }
+       )
+       private List<EpMicroservice> epMicroservices = new ArrayList<>();
+       @OneToMany(
+               targetEntity = EpWidgetCatalogRole.class,
+               mappedBy = "widgetId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<EpWidgetCatalogRole> widgetCatalogRoles = new ArrayList<>();
+       @OneToMany(
+               targetEntity = EpPersUserWidgetSel.class,
+               mappedBy = "widgetId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<EpPersUserWidgetSel> epPersUserWidgetSels = new ArrayList<>();
+       @OneToMany(
+               targetEntity = EpPersUserWidgetSel.class,
+               mappedBy = "widgetId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<EpPersUserWidgetSel> persUserWidgetSels = new ArrayList<>();
+       @OneToMany(
+               targetEntity = EpPersUserWidgetPlacement.class,
+               mappedBy = "widgetId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<EpPersUserWidgetPlacement> epPersUserWidgetPlacements = new ArrayList<>();
+       @OneToMany(
+               targetEntity = EpWidgetCatalogParameter.class,
+               mappedBy = "widgetId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<EpWidgetCatalogParameter> epWidgetCatalogParameters = new ArrayList<>();
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpWidgetCatalogFiles.java b/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpWidgetCatalogFiles.java
new file mode 100644 (file)
index 0000000..db9fc15
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.ep;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+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.NotNull;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+CREATE TABLE `ep_widget_catalog_files` (
+        `file_id` int(11) NOT NULL AUTO_INCREMENT,
+        `widget_id` int(11) DEFAULT NULL,
+        `widget_name` varchar(100) NOT NULL,
+        `framework_js` longblob DEFAULT NULL,
+        `controller_js` longblob DEFAULT NULL,
+        `markup_html` longblob DEFAULT NULL,
+        `widget_css` longblob DEFAULT NULL,
+        PRIMARY KEY (`file_id`)
+        )
+*/
+
+@Table(name = "ep_widget_catalog_files")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class EpWidgetCatalogFiles {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "file_id", length = 11, nullable = false, columnDefinition = "int(11) AUTO_INCREMENT")
+       @Digits(integer = 11, fraction = 0)
+       private Long fileId;
+       @Column(name = "widget_id", length = 11, columnDefinition = " int(11) DEFAULT NULL")
+       @Digits(integer = 11, fraction = 0)
+       private Long widgetId;
+       @Column(name = "widget_name", length = 100, nullable = false)
+       @Size(max = 100)
+       @NotNull
+       @SafeHtml
+       private String widgetName;
+       @Column(name = "framework_js", columnDefinition = "longblob DEFAULT NULL")
+       private byte[] frameworkJs;
+       @Column(name = "controller_js", columnDefinition = "longblob DEFAULT NULL")
+       private byte[] controllerJs;
+       @Column(name = "markup_html", columnDefinition = "longblob DEFAULT NULL")
+       private byte[] markupHtml;
+       @Column(name = "widget_css", columnDefinition = "longblob DEFAULT NULL")
+       private byte[] widgetCss;
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpWidgetCatalogParameter.java b/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpWidgetCatalogParameter.java
new file mode 100644 (file)
index 0000000..c63245c
--- /dev/null
@@ -0,0 +1,117 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.ep;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Index;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.validation.Valid;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.onap.portal.domain.db.fn.FnUser;
+
+/*
+CREATE TABLE `ep_widget_catalog_parameter` (
+        `id` int(11) NOT NULL AUTO_INCREMENT,
+        `widget_id` int(11) NOT NULL,
+        `user_id` int(11) NOT NULL,
+        `param_id` int(11) NOT NULL,
+        `user_value` varchar(50) DEFAULT NULL,
+        PRIMARY KEY (`id`),
+        KEY `EP_FN_USER_WIDGET_PARAMETER_FK` (`user_id`),
+        KEY `EP_WIDGET_CATALOG_WIDGET_PARAMETER_FK` (`widget_id`),
+        KEY `EP_PARAMETER_ID_WIDGET_PARAMETER_FK` (`param_id`),
+        CONSTRAINT `EP_FN_USER_WIDGET_PARAMETER_FK` FOREIGN KEY (`user_id`) REFERENCES `fn_user` (`user_id`),
+        CONSTRAINT `EP_PARAMETER_ID_WIDGET_PARAMETER_FK` FOREIGN KEY (`param_id`) REFERENCES `ep_microservice_parameter` (`id`),
+        CONSTRAINT `EP_WIDGET_CATALOG_WIDGET_PARAMETER_FK` FOREIGN KEY (`widget_id`) REFERENCES `ep_widget_catalog` (`widget_id`)
+        )
+*/
+
+@Table(name = "ep_widget_catalog_parameter", indexes = {
+        @Index(name = "EP_FN_USER_WIDGET_PARAMETER_FK", columnList = "user_id"),
+        @Index(name = "EP_WIDGET_CATALOG_WIDGET_PARAMETER_FK", columnList = "widget_id"),
+        @Index(name = "EP_PARAMETER_ID_WIDGET_PARAMETER_FK", columnList = "param_id")
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class EpWidgetCatalogParameter {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "id", length = 11, nullable = false, columnDefinition = "int(11) AUTO_INCREMENT")
+       @Digits(integer = 11, fraction = 0)
+       private Integer id;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "widget_id", nullable = false)
+       @NotNull
+       @Valid
+       private EpWidgetCatalog widgetId;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "user_id", nullable = false)
+       @NotNull
+       @Valid
+       private FnUser userId;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "param_id", nullable = false)
+       @NotNull
+       @Valid
+       private EpMicroserviceParameter paramId;
+       @Column(name = "user_value", length = 50, columnDefinition = "varchar(50) DEFAULT NULL")
+       @Size(max = 50)
+       @SafeHtml
+       private String userValue;
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpWidgetCatalogRole.java b/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpWidgetCatalogRole.java
new file mode 100644 (file)
index 0000000..d219181
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.ep;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.Id;
+import javax.persistence.Index;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.validation.Valid;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotNull;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.onap.portal.domain.db.fn.FnApp;
+import org.onap.portal.domain.db.fn.FnRole;
+
+/*
+CREATE TABLE `ep_widget_catalog_role` (
+        `widget_id` int(10) NOT NULL,
+        `app_id` int(11) DEFAULT 1,
+        `role_id` int(10) NOT NULL,
+        KEY `fk_ep_widget_catalog_role_fn_widget` (`widget_id`),
+        KEY `fk_ep_widget_catalog_role_ref_fn_role` (`role_id`),
+        KEY `fk_ep_widget_catalog_role_app_id` (`app_id`),
+        CONSTRAINT `fk_ep_widget_catalog_role_app_id` FOREIGN KEY (`app_id`) REFERENCES `fn_app` (`app_id`),
+        CONSTRAINT `fk_ep_widget_catalog_role_fn_widget` FOREIGN KEY (`widget_id`) REFERENCES `ep_widget_catalog` (`widget_id`),
+        CONSTRAINT `fk_ep_widget_catalog_role_ref_fn_role` FOREIGN KEY (`role_id`) REFERENCES `fn_role` (`role_id`)
+        )
+*/
+
+@Table(name = "ep_widget_catalog_role", indexes = {
+        @Index(name = "fk_ep_widget_catalog_role_fn_widget", columnList = "widget_id"),
+        @Index(name = "fk_ep_widget_catalog_role_ref_fn_role", columnList = "role_id"),
+        @Index(name = "fk_ep_widget_catalog_role_app_id", columnList = "app_id")
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+//TODO there is something wrong with "KEY"
+public class EpWidgetCatalogRole {
+       @Id
+       @Column(name = "id", length = 11, nullable = false)
+       @Digits(integer = 11, fraction = 0)
+       private Long id;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "widget_id", nullable = false)
+       @NotNull
+       @Valid
+       private EpWidgetCatalog widgetId;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "app_id", columnDefinition = "bigint default '1'")
+       @Valid
+       private FnApp appId;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "role_id", nullable = false)
+       @NotNull
+       @Valid
+       private FnRole roleId;
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpWidgetPreviewFiles.java b/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpWidgetPreviewFiles.java
new file mode 100644 (file)
index 0000000..b66ef62
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.ep;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.validation.constraints.Digits;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+/*
+CREATE TABLE `ep_widget_preview_files` (
+        `preview_id` int(11) NOT NULL AUTO_INCREMENT,
+        `html_file` longblob DEFAULT NULL,
+        `css_file` longblob DEFAULT NULL,
+        `javascript_file` longblob DEFAULT NULL,
+        `framework_file` longblob DEFAULT NULL,
+        PRIMARY KEY (`preview_id`)
+        )
+*/
+
+@Table(name = "ep_widget_preview_files")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class EpWidgetPreviewFiles {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "preview_id", length = 11, nullable = false, columnDefinition = "int(11) AUTO_INCREMENT")
+       @Digits(integer = 11, fraction = 0)
+       private Integer previewId;
+       @Column(name = "html_file", columnDefinition = "longblob DEFAULT NULL")
+       private byte[] htmlFile;
+       @Column(name = "css_file", columnDefinition = "longblob DEFAULT NULL")
+       private byte[] cssFile;
+       @Column(name = "javascript_file", columnDefinition = "longblob DEFAULT NULL")
+       private byte[] javascriptFile;
+       @Column(name = "framework_file", columnDefinition = "longblob DEFAULT NULL")
+       private byte[] frameworkFile;
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnApp.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnApp.java
new file mode 100644 (file)
index 0000000..79cc632
--- /dev/null
@@ -0,0 +1,287 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Embeddable;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+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.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.hibernate.validator.constraints.URL;
+import org.onap.portal.domain.db.ep.EpAppFunction;
+import org.onap.portal.domain.db.ep.EpAppRoleFunction;
+import org.onap.portal.domain.db.ep.EpMicroservice;
+import org.onap.portal.domain.db.ep.EpUserRolesRequest;
+import org.onap.portal.domain.db.ep.EpWebAnalyticsSource;
+import org.onap.portal.domain.db.ep.EpWidgetCatalogRole;
+import org.onap.portal.domain.dto.DomainVo;
+
+/*
+CREATE TABLE `fn_app` (
+        `app_id` int(11) NOT NULL AUTO_INCREMENT,
+        `app_name` varchar(100) NOT NULL DEFAULT '?',
+        `app_image_url` varchar(256) DEFAULT NULL,
+        `app_description` varchar(512) DEFAULT NULL,
+        `app_notes` varchar(4096) DEFAULT NULL,
+        `app_url` varchar(256) DEFAULT NULL,
+        `app_alternate_url` varchar(256) DEFAULT NULL,
+        `app_rest_endpoint` varchar(2000) DEFAULT NULL,
+        `ml_app_name` varchar(50) NOT NULL DEFAULT '?',
+        `ml_app_admin_id` varchar(7) NOT NULL DEFAULT '?',
+        `mots_id` int(11) DEFAULT NULL,
+        `app_password` varchar(256) NOT NULL DEFAULT '?',
+        `open` char(1) DEFAULT 'N',
+        `enabled` char(1) DEFAULT 'Y',
+        `thumbnail` mediumblob DEFAULT NULL,
+        `app_username` varchar(50) DEFAULT NULL,
+        `ueb_key` varchar(256) DEFAULT NULL,
+        `ueb_secret` varchar(256) DEFAULT NULL,
+        `ueb_topic_name` varchar(256) DEFAULT NULL,
+        `app_type` int(11) NOT NULL DEFAULT 1,
+        `auth_central` char(1) NOT NULL DEFAULT 'N',
+        `auth_namespace` varchar(100) DEFAULT NULL,
+        PRIMARY KEY (`app_id`)
+        )
+*/
+
+@NamedQueries({
+        @NamedQuery(
+                name = "FnApp.retrieveWhereAuthCentralIsYAndOpenIsNAndAuthNamespaceIsNotNull",
+                query = "from FnApp where auth_central = 'Y' and open = 'N' and auth_namespace is not null")
+})
+
+@Table(name = "fn_app")
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@Embeddable
+@Getter
+@Setter
+@Entity
+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")
+       @Digits(integer = 11, fraction = 0)
+       private Long appId;
+       @Column(name = "app_name", length = 100, nullable = false, columnDefinition = "varchar(100) not null default '?'")
+       @Size(max = 100)
+       @SafeHtml
+       @NotNull
+       private String appName;
+       @Column(name = "app_image_url", length = 256)
+       @Size(max = 256)
+       @SafeHtml
+       private String appImageUrl;
+       @Column(name = "app_description", length = 512)
+       @Size(max = 256)
+       @SafeHtml
+       private String appDescription;
+       @Column(name = "app_notes", length = 4096)
+       @Size(max = 4096)
+       @SafeHtml
+       private String appNotes;
+       @Column(name = "app_url", length = 256)
+       @Size(max = 256)
+       @SafeHtml
+       //TODO URL
+       @URL
+       private String appUrl;
+       @Column(name = "app_alternate_url", length = 256)
+       @Size(max = 256)
+       @SafeHtml
+       private String appAlternateUrl;
+       @Column(name = "app_rest_endpoint", length = 2000)
+       @Size(max = 2000)
+       @SafeHtml
+       private String appRestEndpoint;
+       @Column(name = "ml_app_name", length = 50, nullable = false, columnDefinition = "varchar(50) not null default '?'")
+       @Size(max = 50)
+       @SafeHtml
+       @NotNull
+       private String ml_app_name;
+       @Column(name = "ml_app_admin_id", length = 7, nullable = false, columnDefinition = "varchar(7) not null default '?'")
+       @Size(max = 7)
+       @SafeHtml
+       @NotNull
+       private String mlAppAdminId;
+       @Column(name = "mots_id", length = 11)
+       @Digits(integer = 11, fraction = 0)
+       private Long motsId;
+       @Column(name = "app_password", length = 256, nullable = false, columnDefinition = "varchar(256) not null default '?'")
+       @Size(max = 256)
+       @SafeHtml
+       @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;
+       @Column(name = "ENABLED", length = 1, columnDefinition = "char(1) default 'N'")
+       @Pattern(regexp = "[YNyn]")
+       @Size(max = 1)
+       @NotNull
+       @SafeHtml
+       private String enabled;
+       @Column(name = "active_yn", length = 1, columnDefinition = "char(1) default 'Y'")
+       @Pattern(regexp = "[YNyn]")
+       @Size(max = 1)
+       @NotNull
+       @SafeHtml
+       private String activeYn;
+       @Column(name = "thumbnail", columnDefinition = "mediumblob null default null")
+       private byte[] thumbnail;
+       @Column(name = "app_username", length = 50)
+       @Size(max = 50)
+       @SafeHtml
+       private String appUsername;
+       @Column(name = "ueb_key", length = 256)
+       @Size(max = 256)
+       @SafeHtml
+       private String uebKey;
+       @Column(name = "ueb_secret", length = 256)
+       @Size(max = 256)
+       @SafeHtml
+       private String uebSecret;
+       @Column(name = "ueb_topic_name", length = 256)
+       @Size(max = 256)
+       @SafeHtml
+       private String uebTopicName;
+       @Column(name = "app_type", length = 11, columnDefinition = "int(11) not null default 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;
+       @Column(name = "auth_namespace", length = 100)
+       @Size(max = 100)
+       @SafeHtml
+       private String authNamespace;
+       @OneToMany(
+               targetEntity = FnMenuFunctionalRoles.class,
+               mappedBy = "appId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<FnMenuFunctionalRoles> fnMenuFunctionalRoles = new ArrayList<>();
+       @OneToMany(
+               targetEntity = EpUserRolesRequest.class,
+               mappedBy = "appId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<EpUserRolesRequest> epUserRolesRequests = new ArrayList<>();
+       @OneToMany(
+               targetEntity = EpAppFunction.class,
+               mappedBy = "appId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<EpAppFunction> epAppFunctions = new ArrayList<>();
+       @OneToMany(
+               targetEntity = EpAppRoleFunction.class,
+               mappedBy = "appId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<EpAppRoleFunction> epAppRoleFunctions = new ArrayList<>();
+       @OneToMany(
+               targetEntity = FnUserRole.class,
+               mappedBy = "appId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<FnUserRole> fnUserRoles = new ArrayList<>();
+       @OneToMany(
+               targetEntity = EpWebAnalyticsSource.class,
+               mappedBy = "appId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<EpWebAnalyticsSource> epWebAnalyticsSources = new ArrayList<>();
+       @OneToMany(
+               targetEntity = EpWidgetCatalogRole.class,
+               mappedBy = "appId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<EpWidgetCatalogRole> epWidgetCatalogRoles = new ArrayList<>();
+       @OneToMany(
+               targetEntity = EpMicroservice.class,
+               mappedBy = "appId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<EpMicroservice> epMicroservices = new ArrayList<>();
+       @OneToMany(
+               targetEntity = FnPersUserAppSel.class,
+               mappedBy = "appId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<FnPersUserAppSel> fnPersUserAppSels = new ArrayList<>();
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnAppContactUs.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnAppContactUs.java
new file mode 100644 (file)
index 0000000..26fd466
--- /dev/null
@@ -0,0 +1,177 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import java.io.Serializable;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.EntityResult;
+import javax.persistence.FetchType;
+import javax.persistence.FieldResult;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.MapsId;
+import javax.persistence.NamedNativeQueries;
+import javax.persistence.NamedNativeQuery;
+import javax.persistence.OneToOne;
+import javax.persistence.SqlResultSetMapping;
+import javax.persistence.Table;
+import javax.validation.Valid;
+import javax.validation.constraints.Pattern;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.hibernate.validator.constraints.URL;
+import org.onap.portal.domain.dto.DomainVo;
+
+/*
+CREATE TABLE `fn_app_contact_us` (
+        `app_id` int(11) NOT NULL,
+        `contact_name` varchar(128) DEFAULT NULL,
+        `contact_email` varchar(128) DEFAULT NULL,
+        `url` varchar(256) DEFAULT NULL,
+        `active_yn` varchar(2) DEFAULT NULL,
+        `description` varchar(1024) DEFAULT NULL,
+        PRIMARY KEY (`app_id`),
+        CONSTRAINT `fk_fn_a_con__ref_202_fn_app` FOREIGN KEY (`app_id`) REFERENCES `fn_app` (`app_id`)
+        )
+*/
+
+@SqlResultSetMapping(
+        name = "fnAppContactUsMapping",
+        entities = {
+                @EntityResult(
+                        entityClass = FnAppContactUs.class,
+                        fields = {
+                                @FieldResult(name = "appId", column = "app_Id"),
+                                @FieldResult(name = "contactName", column = "contactName"),
+                                @FieldResult(name = "contact_email", column = "contactEmail"),
+                                @FieldResult(name = "description", column = "description"),
+                                @FieldResult(name = "activeYN", column = "activeYN")
+                        }
+                )
+        })
+
+@NamedNativeQueries({
+        @NamedNativeQuery(
+                name = "FnAppContactUs.getAppsAndContacts",
+                query = "select "
+                        + "a.app_id as app_Id, a.app_name as appName,"
+                        + "c.contact_name as contactName, "
+                        + "c.contact_email as contactEmail, c.url, c.description, "
+                        + "c.active_yn as activeYN"
+                        + "from "
+                        + "fn_app a"
+                        + "left join "
+                        + "fn_app_contact_us c"
+                        + "on a.app_id = c.app_id"
+                        + "where "
+                        + "a.enabled = 'Y' and a.app_name is not null and a.app_name != '';",
+                resultClass = FnAppContactUs.class,
+                resultSetMapping = "fnAppContactUsMapping"),
+        @NamedNativeQuery(
+                name = "FnAppContactUs.getAppContactUsItems",
+                query = "select\n"
+                        + "  c.app_id as app_Id,\n"
+                        + "  c.contact_name as contact_name,\n"
+                        + "  c.contact_email as contact_email,\n"
+                        + "  c.url,\n"
+                        + "  c.description,\n"
+                        + "  c.active_yn as active_yn,\n"
+                        + "  a.app_name as appName\n"
+                        + "from\n"
+                        + "  fn_app_contact_us c\n"
+                        + "  left join fn_app a on a.app_id = c.app_id\n"
+                        + "where\n"
+                        + "  a.enabled = 'Y'\n"
+                        + "  and a.app_name is not null\n"
+                        + "  and a.app_name != ''",
+                resultClass = FnAppContactUs.class,
+                resultSetMapping = "fnAppContactUsMapping")
+})
+
+@Table(name = "fn_app_contact_us")
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@Getter
+@Setter
+@Entity
+public class FnAppContactUs extends DomainVo implements Serializable {
+       @Id
+       @Column(name = "app_id")
+       private Long appId;
+
+       @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+       @JoinColumn(name = "app_id")
+       @MapsId
+       @Valid
+       private FnApp fnApp;
+       @Column(name = "contact_name", length = 128, columnDefinition = "varchar(128) default null")
+       @Size(max = 128)
+       @SafeHtml
+       private String contactName;
+       @Column(name = "contact_email", length = 128, columnDefinition = "varchar(128) default null")
+       @Size(max = 128)
+       @SafeHtml
+       private String contactEmail;
+       @Column(name = "url", length = 256, columnDefinition = "varchar(128) default null")
+       @Size(max = 256)
+       @SafeHtml
+       //TODO URL
+       @URL
+       private String url;
+       @Column(name = "active_yn", length = 1, columnDefinition = "varchar(1) default null")
+       @Pattern(regexp = "[YNyn]")
+       @Size(max = 1)
+       @SafeHtml
+       private String activeYn;
+       @Column(name = "description", length = 1024, columnDefinition = "varchar(1024) default null")
+       @Size(max = 1024)
+       @SafeHtml
+       private String description;
+
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnAuditAction.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnAuditAction.java
new file mode 100644 (file)
index 0000000..d85ee2a
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Pattern;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+CREATE TABLE `fn_audit_action` (
+        `audit_action_id` int(11) NOT NULL,
+        `class_name` varchar(500) NOT NULL,
+        `method_name` varchar(50) NOT NULL,
+        `audit_action_cd` varchar(20) NOT NULL,
+        `audit_action_desc` varchar(200) DEFAULT NULL,
+        `active_yn` varchar(1) DEFAULT NULL,
+        PRIMARY KEY (`audit_action_id`)
+        )
+*/
+
+@Table(name = "fn_audit_action")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class FnAuditAction {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "role_id", nullable = false)
+       private Integer roleId;
+       @Column(name = "class_name", length = 500, nullable = false)
+       @Size(max = 500)
+       @NotNull
+       @SafeHtml
+       private String className;
+       @Column(name = "method_name", length = 50, nullable = false)
+       @Size(max = 50)
+       @NotNull
+       @SafeHtml
+       private String methodName;
+       @Column(name = "audit_action_cd", length = 20, nullable = false)
+       @Size(max = 20)
+       @NotNull
+       @SafeHtml
+       private String auditActionCd;
+       @Column(name = "audit_action_desc", length = 200)
+       @Size(max = 200)
+       @NotNull
+       @SafeHtml
+       private String auditActionDesc;
+       @Column(name = "active_yn", length = 1)
+       @Pattern(regexp = "[YNyn]")
+       @Size(max = 1)
+       @SafeHtml
+       private String active_yn;
+
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnAuditActionLog.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnAuditActionLog.java
new file mode 100644 (file)
index 0000000..ccea932
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import java.time.LocalDateTime;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+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.PastOrPresent;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+CREATE TABLE `fn_audit_action_log` (
+        `audit_log_id` int(11) NOT NULL AUTO_INCREMENT,
+        `audit_action_cd` varchar(200) DEFAULT NULL,
+        `action_time` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
+        `user_id` decimal(11,0) DEFAULT NULL,
+        `class_name` varchar(100) DEFAULT NULL,
+        `method_name` varchar(50) DEFAULT NULL,
+        `success_msg` varchar(20) DEFAULT NULL,
+        `error_msg` varchar(500) DEFAULT NULL,
+        PRIMARY KEY (`audit_log_id`)
+        )
+*/
+
+@Table(name = "fn_audit_action_log")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class FnAuditActionLog {
+
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "audit_log_id", nullable = false, columnDefinition = "int(11) AUTO_INCREMENT")
+       private Integer auditLogId;
+       @Column(name = "audit_action_cd", length = 200)
+       @Size(max = 200)
+       @SafeHtml
+       private String auditActionCd;
+       @Column(name = "action_time", nullable = false, columnDefinition = "datetime DEFAULT current_timestamp() ON UPDATE current_timestamp()")
+       @PastOrPresent
+       private LocalDateTime actionTime;
+       @Column(name = "user_id", length = 11)
+       @Digits(integer = 11, fraction = 0)
+       private Long userId;
+       @Column(name = "class_name", length = 100)
+       @Size(max = 100)
+       @SafeHtml
+       private String className;
+       @Column(name = "methodName", length = 50)
+       @Size(max = 50)
+       @SafeHtml
+       private String methodName;
+       @Column(name = "success_msg", length = 20)
+       @Size(max = 20)
+       @SafeHtml
+       private String successMsg;
+       @Column(name = "error_msg", length = 500)
+       @Size(max = 500)
+       @SafeHtml
+       private String errorMsg;
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnAuditLog.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnAuditLog.java
new file mode 100644 (file)
index 0000000..8f5e5c0
--- /dev/null
@@ -0,0 +1,123 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import java.time.LocalDateTime;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Index;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.validation.Valid;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+CREATE TABLE `fn_audit_log` (
+        `log_id` int(11) NOT NULL AUTO_INCREMENT,
+        `user_id` int(11) NOT NULL,
+        `activity_cd` varchar(50) NOT NULL,
+        `audit_date` timestamp NOT NULL DEFAULT current_timestamp(),
+        `comments` varchar(1000) DEFAULT NULL,
+        `affected_record_id_bk` varchar(500) DEFAULT NULL,
+        `affected_record_id` varchar(4000) DEFAULT NULL,
+        PRIMARY KEY (`log_id`),
+        KEY `fn_audit_log_activity_cd` (`activity_cd`) USING BTREE,
+        KEY `fn_audit_log_user_id` (`user_id`) USING BTREE,
+        CONSTRAINT `fk_fn_audit_ref_205_fn_lu_ac` FOREIGN KEY (`activity_cd`) REFERENCES `fn_lu_activity` (`activity_cd`),
+        CONSTRAINT `fk_fn_audit_ref_209_fn_user` FOREIGN KEY (`user_id`) REFERENCES `fn_user` (`user_id`)
+        )
+*/
+
+@Table(name = "fn_audit_log", indexes = {
+        @Index(name = "fn_audit_log_activity_cd", columnList = "activity_cd"),
+        @Index(name = "fn_audit_log_user_id", columnList = "user_id")
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class FnAuditLog {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "log_id", length = 11, nullable = false, columnDefinition = "int(11) AUTO_INCREMENT")
+       @Digits(integer = 11, fraction = 0)
+       private Integer logId;
+       @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
+       @JoinColumn(name = "user_id", nullable = false)
+       @NotNull
+       @Valid
+       private FnUser userId;
+       @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+       @JoinColumn(name = "activity_cd", nullable = false)
+       @NotNull
+       @Valid
+       private FnLuActivity activityCd;
+       @Column(name = "audit_date", columnDefinition = "datetime default now()", nullable = false)
+       @NotNull
+       private LocalDateTime auditDate;
+       @Column(name = "comments", length = 1000)
+       @Size(max = 1000)
+       @SafeHtml
+       private String comments;
+       @Column(name = "affected_record_id_bk", length = 500)
+       @Size(max = 5000)
+       @SafeHtml
+       private String affectedRecordIdBk;
+       @Column(name = "affected_record_id", length = 4000)
+       @Size(max = 4000)
+       @SafeHtml
+       private String affectedRecordId;
+
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnBroadcastMessage.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnBroadcastMessage.java
new file mode 100644 (file)
index 0000000..c863fcb
--- /dev/null
@@ -0,0 +1,117 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import java.time.LocalDateTime;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+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.NotNull;
+import javax.validation.constraints.Pattern;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+CREATE TABLE `fn_broadcast_message` (
+        `message_id` int(11) NOT NULL AUTO_INCREMENT,
+        `message_text` varchar(1000) NOT NULL,
+        `message_location_id` decimal(11,0) NOT NULL,
+        `broadcast_start_date` timestamp NOT NULL DEFAULT current_timestamp(),
+        `broadcast_end_date` timestamp NOT NULL DEFAULT current_timestamp(),
+        `active_yn` char(1) NOT NULL DEFAULT 'y',
+        `sort_order` decimal(4,0) NOT NULL,
+        `broadcast_site_cd` varchar(50) DEFAULT NULL,
+        PRIMARY KEY (`message_id`)
+        )
+*/
+
+@Table(name = "fn_broadcast_message")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class FnBroadcastMessage {
+
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "message_id", length = 11, nullable = false, columnDefinition = "int(11) AUTO_INCREMENT")
+       @Digits(integer = 11, fraction = 0)
+       private Long messageId;
+       @Column(name = "message_text", length = 10000, nullable = false)
+       @Size(max = 50)
+       @NotNull
+       @SafeHtml
+       private String messageText;
+       @Column(name = "message_location_id", length = 11, nullable = false)
+       @Digits(integer = 11, fraction = 0)
+       @NotNull
+       private Long messageLocationId;
+       @Column(name = "broadcast_start_date", columnDefinition = "timestamp DEFAULT current_timestamp()", nullable = false)
+       @NotNull
+       private LocalDateTime broadcastStartDate;
+       @Column(name = "broadcast_end_date", columnDefinition = "timestamp DEFAULT current_timestamp()", nullable = false)
+       @NotNull
+       private LocalDateTime broadcastEndDate;
+       @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;
+       @Column(name = "sort_order", length = 4, nullable = false)
+       @Digits(integer = 4, fraction = 0)
+       @NotNull
+       private Long sortOrder;
+       @Column(name = "broadcast_site_cd", length = 50)
+       @Size(max = 50)
+       @SafeHtml
+       private String broadcastSiteCd;
+
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnChatLogs.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnChatLogs.java
new file mode 100644 (file)
index 0000000..ab24e29
--- /dev/null
@@ -0,0 +1,89 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import java.time.LocalDateTime;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+CREATE TABLE `fn_chat_logs` (
+        `chat_log_id` int(11) NOT NULL,
+        `chat_room_id` int(11) DEFAULT NULL,
+        `user_id` int(11) DEFAULT NULL,
+        `message` varchar(1000) DEFAULT NULL,
+        `message_date_time` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
+        PRIMARY KEY (`chat_log_id`)
+        )
+*/
+
+@Table(name = "fn_chat_logs")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class FnChatLogs {
+       @Id
+       @Column(name = "chat_log_id", nullable = false)
+       private Long chatLogId;
+       @Column(name = "chat_room_id")
+       private Long chatRoomId;
+       @Column(name = "user_id")
+       private Long userId;
+       @Column(name = "message", length = 1000)
+       @Size(max = 1000)
+       @SafeHtml
+       private String message;
+       @Column(name = "message_date_time", nullable = false, columnDefinition = "DATETIME DEFAULT current_timestamp() ON UPDATE current_timestamp()")
+       private LocalDateTime messageDateTime;
+
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnChatRoom.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnChatRoom.java
new file mode 100644 (file)
index 0000000..c61d9f1
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import java.time.LocalDateTime;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.PastOrPresent;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+CREATE TABLE `fn_chat_room` (
+        `chat_room_id` int(11) NOT NULL,
+        `name` varchar(50) NOT NULL,
+        `description` varchar(500) DEFAULT NULL,
+        `owner_id` int(11) DEFAULT NULL,
+        `created_date` timestamp NOT NULL DEFAULT current_timestamp(),
+        `updated_date` timestamp NOT NULL DEFAULT current_timestamp(),
+        PRIMARY KEY (`chat_room_id`)
+        )
+*/
+
+@Table(name = "fn_chat_room")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class FnChatRoom {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "chat_room_id", nullable = false)
+       @NotNull
+       private Integer chatRoomId;
+       @Column(name = "name", length = 50, nullable = false)
+       @Size(max = 50)
+       @NotNull
+       @SafeHtml
+       private String name;
+       @Column(name = "description", length = 500)
+       @Size(max = 500)
+       @SafeHtml
+       private String description;
+       @Column(name = "owner_id")
+       private Integer ownerId;
+       @Column(name = "created_date", nullable = false, columnDefinition = "datetime default now()")
+       @PastOrPresent
+       private LocalDateTime createdDate;
+       @Column(name = "updated_date", nullable = false, columnDefinition = "datetime default now()")
+       @PastOrPresent
+       private LocalDateTime updatedDate;
+
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnChatUsers.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnChatUsers.java
new file mode 100644 (file)
index 0000000..85e9b59
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import java.time.LocalDateTime;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.PastOrPresent;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+CREATE TABLE `fn_chat_users` (
+        `chat_room_id` int(11) DEFAULT NULL,
+        `user_id` int(11) DEFAULT NULL,
+        `last_activity_date_time` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
+        `chat_status` varchar(20) DEFAULT NULL,
+        `id` int(11) NOT NULL,
+        PRIMARY KEY (`id`)
+        )
+*/
+
+@Table(name = "fn_chat_users")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class FnChatUsers {
+       @Id
+       @Column(name = "id", length = 11, nullable = false)
+       @Digits(integer = 11, fraction = 0)
+       @NotNull
+       private Long id;
+       @Column(name = "chat_room_id", length = 11)
+       @Digits(integer = 11, fraction = 0)
+       private Long chatRoomId;
+       @Column(name = "user_id", length = 11)
+       @Digits(integer = 11, fraction = 0)
+       private Long userId;
+       @Column(name = "last_activity_date_time", nullable = false, columnDefinition = "DATETIME DEFAULT current_timestamp() ON UPDATE current_timestamp()")
+       @PastOrPresent
+       private LocalDateTime lastActivityDateTime;
+       @Column(name = "chat_status", length = 20)
+       @Size(max = 20)
+       @SafeHtml
+       private String chatStatus;
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnCommonWidgetData.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnCommonWidgetData.java
new file mode 100644 (file)
index 0000000..ac8f23c
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+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.Pattern;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+/*
+CREATE TABLE `fn_common_widget_data` (
+        `id` int(11) NOT NULL AUTO_INCREMENT,
+        `category` varchar(32) DEFAULT NULL,
+        `href` varchar(512) DEFAULT NULL,
+        `title` varchar(256) DEFAULT NULL,
+        `content` varchar(4096) DEFAULT NULL,
+        `event_date` varchar(10) DEFAULT NULL,
+        `sort_order` int(11) DEFAULT NULL,
+        PRIMARY KEY (`id`)
+        )
+*/
+
+@Table(name = "fn_common_widget_data")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class FnCommonWidgetData {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "id", nullable = false, columnDefinition = "int(11) AUTO_INCREMENT")
+       private Long id;
+       @Column(name = "category", length = 32)
+       @Size(max = 32)
+       @SafeHtml
+       private String category;
+       @Column(name = "href", length = 512)
+       @Size(max = 512)
+       @SafeHtml
+       private String href;
+       @Column(name = "title", length = 256)
+       @Size(max = 256)
+       @SafeHtml
+       private String title;
+       @Column(name = "content", length = 4096)
+       @Size(max = 4096)
+       @SafeHtml
+       private String content;
+       @Column(name = "event_date", length = 10)
+       @Pattern(regexp = "([1-2][0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])")
+       @Size(max = 10)
+       @SafeHtml
+       private String eventDate;
+       @Column(name = "sort_order")
+       @Digits(integer = 11, fraction = 0)
+       private Long sortOrder;
+
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnDatasource.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnDatasource.java
new file mode 100644 (file)
index 0000000..73dfa8a
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+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.Max;
+import javax.validation.constraints.Min;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.hibernate.validator.constraints.URL;
+
+/*
+CREATE TABLE `fn_datasource` (
+        `id` int(11) NOT NULL AUTO_INCREMENT,
+        `name` varchar(50) DEFAULT NULL,
+        `driver_name` varchar(256) DEFAULT NULL,
+        `server` varchar(256) DEFAULT NULL,
+        `port` int(11) DEFAULT NULL,
+        `user_name` varchar(256) DEFAULT NULL,
+        `password` varchar(256) DEFAULT NULL,
+        `url` varchar(256) DEFAULT NULL,
+        `min_pool_size` int(11) DEFAULT NULL,
+        `max_pool_size` int(11) DEFAULT NULL,
+        `adapter_id` int(11) DEFAULT NULL,
+        `ds_type` varchar(20) DEFAULT NULL,
+        PRIMARY KEY (`id`)
+        )
+*/
+
+@Table(name = "fn_datasource")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class FnDatasource {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "message_id", length = 11, nullable = false, columnDefinition = "int(11) AUTO_INCREMENT")
+       @Digits(integer = 11, fraction = 0)
+       private Long messageId;
+       @Column(name = "name", length = 50)
+       @Size(max = 50)
+       @SafeHtml
+       private String name;
+       @Column(name = "driver_name", length = 256)
+       @Size(max = 256)
+       @SafeHtml
+       private String driverName;
+       @Column(name = "server", length = 256)
+       @Size(max = 256)
+       @SafeHtml
+       private String server;
+       @Column(name = "port", length = 11)
+       @Min(value = 0)
+       @Max(value = 65535)
+       private Long port;
+       @Column(name = "user_name", length = 256)
+       @Size(max = 256)
+       @SafeHtml
+       private String userName;
+       @Column(name = "password", length = 256)
+       @Size(max = 256)
+       @SafeHtml
+       private String password;
+       //TODO URL
+       @Column(name = "url", length = 256)
+       @Size(max = 256)
+       @SafeHtml
+       @URL
+       private String url;
+       @Column(name = "min_pool_size")
+       private Long minPoolSize;
+       @Column(name = "max_pool_size")
+       private Long maxPoolSize;
+       @Column(name = "adapter_id")
+       private Long adapterId;
+       @Column(name = "ds_type", length = 20)
+       @Size(max = 20)
+       @SafeHtml
+       private String dsType;
+
+
+
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnDisplayText.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnDisplayText.java
new file mode 100644 (file)
index 0000000..e79126c
--- /dev/null
@@ -0,0 +1,95 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+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.NotNull;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+CREATE TABLE `fn_display_text` (
+        `id` int(11) NOT NULL AUTO_INCREMENT,
+        `language_id` int(11) NOT NULL,
+        `text_id` int(11) NOT NULL,
+        `text_label` varchar(100) NOT NULL,
+        PRIMARY KEY (`id`)
+        )
+*/
+
+@Table(name = "fn_display_text")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class FnDisplayText {
+
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "id", length = 11, nullable = false, columnDefinition = "int(11) AUTO_INCREMENT")
+       @Digits(integer = 11, fraction = 0)
+       private Long id;
+       @Column(name = "language_id", length = 11, nullable = false)
+       @NotNull
+       @Digits(integer = 11, fraction = 0)
+       private Long languageId;
+       @Column(name = "text_id", length = 11, nullable = false)
+       @NotNull
+       @Digits(integer = 11, fraction = 0)
+       private Long textId;
+       @Column(name = "text_label", length = 100, nullable = false)
+       @Size(max = 100)
+       @NotNull
+       @SafeHtml
+       private String textLabel;
+
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnFunction.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnFunction.java
new file mode 100644 (file)
index 0000000..1635351
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.Id;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+CREATE TABLE `fn_function` (
+        `function_cd` varchar(30) NOT NULL,
+        `function_name` varchar(50) NOT NULL,
+        PRIMARY KEY (`function_cd`)
+        )
+*/
+
+@Table(name = "fn_function")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class FnFunction {
+       @Id
+       @Column(name = "function_cd", length = 30, nullable = false)
+       @Size(max = 30)
+       @SafeHtml
+       private String functionCd;
+       @Column(name = "function_name", length = 50, nullable = false)
+       @Size(max = 50)
+       @SafeHtml
+       @NotNull
+       private String functionName;
+       @OneToMany(
+               targetEntity = FnRestrictedUrl.class,
+               mappedBy = "functionCd",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<FnRestrictedUrl> fnRestrictedUrls = new ArrayList<>();
+       @OneToMany(
+               targetEntity = FnRoleFunction.class,
+               mappedBy = "functionCd",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<FnRoleFunction> fnRoleFunctions = new ArrayList<>();
+       @OneToMany(
+               targetEntity = FnTab.class,
+               mappedBy = "functionCd",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<FnTab> fnTabs = new ArrayList<>();
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLanguage.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLanguage.java
new file mode 100644 (file)
index 0000000..f8dfac2
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+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.NotNull;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+/*
+CREATE TABLE `fn_language` (
+        `language_id` int(11) NOT NULL AUTO_INCREMENT,
+        `language_name` varchar(100) NOT NULL,
+        `language_alias` varchar(100) NOT NULL,
+        PRIMARY KEY (`language_id`)
+        )
+*/
+
+@Table(name = "fn_language")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class FnLanguage {
+
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "language_id", length = 11, nullable = false, columnDefinition = "int(11) AUTO_INCREMENT")
+       @Digits(integer = 11, fraction = 0)
+       private Long languageId;
+       @Column(name = "language_name", length = 100, nullable = false)
+       @Size(max = 100)
+       @NotNull
+       @SafeHtml
+       private String languageName;
+       @Column(name = "language_alias", length = 100, nullable = false)
+       @Size(max = 100)
+       @NotNull
+       @SafeHtml
+       private String languageAlias;
+
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLuActivity.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLuActivity.java
new file mode 100644 (file)
index 0000000..dc5c7e2
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.Id;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+CREATE TABLE `fn_lu_activity` (
+        `activity_cd` varchar(50) NOT NULL,
+        `activity` varchar(50) NOT NULL,
+        PRIMARY KEY (`activity_cd`)
+        )
+*/
+
+@Table(name = "fn_lu_activity")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class FnLuActivity {
+       @Id
+       @Column(name = "activity_cd", length = 50, nullable = false)
+       @Size(max = 50)
+       @NotNull
+       @SafeHtml
+       private String activity_cd;
+       @Column(name = "activity", length = 50, nullable = false)
+       @Size(max = 50)
+       @NotNull
+       @SafeHtml
+       private String activity;
+       @OneToMany(
+               targetEntity = FnAuditLog.class,
+               mappedBy = "activityCd",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<FnAuditLog> fnAuditLogs = new ArrayList<>();
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLuAlertMethod.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLuAlertMethod.java
new file mode 100644 (file)
index 0000000..bc3ef68
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.Id;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+CREATE TABLE `fn_lu_alert_method` (
+        `alert_method_cd` varchar(10) NOT NULL,
+        `alert_method` varchar(50) NOT NULL,
+        PRIMARY KEY (`alert_method_cd`)
+        )
+*/
+
+@Table(name = "fn_lu_alert_method")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class FnLuAlertMethod {
+       @Id
+       @Column(name = "alert_method_cd", length = 10, nullable = false)
+       @Size(max = 50)
+       @SafeHtml
+       private String alertMethodCd;
+       @Column(name = "alert_method", length = 50, nullable = false)
+       @Size(max = 50)
+       @SafeHtml
+       @NotNull
+       private String alertMethod;
+
+       @OneToMany(
+               targetEntity = FnUser.class,
+               mappedBy = "alertMethodCd",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<FnUser> fnUsers = new ArrayList<>();
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLuBroadcastSite.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLuBroadcastSite.java
new file mode 100644 (file)
index 0000000..6d1c723
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+CREATE TABLE `fn_lu_broadcast_site` (
+        `broadcast_site_cd` varchar(50) NOT NULL,
+        `broadcast_site_descr` varchar(100) DEFAULT NULL,
+        PRIMARY KEY (`broadcast_site_cd`)
+        )
+*/
+
+@Table(name = "fn_lu_broadcast_site")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class FnLuBroadcastSite {
+       @Id
+       @Column(name = "broadcast_site_cd", length = 50, nullable = false)
+       @Size(max = 50)
+       @SafeHtml
+       private String broadcastSiteCd;
+       @Column(name = "broadcast_site_descr", length = 100)
+       @Size(max = 100)
+       @SafeHtml
+       private String broadcastSiteDescr;
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLuMenuSet.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLuMenuSet.java
new file mode 100644 (file)
index 0000000..5f3459d
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+CREATE TABLE `fn_lu_menu_set` (
+        `menu_set_cd` varchar(10) NOT NULL,
+        `menu_set_name` varchar(50) NOT NULL,
+        PRIMARY KEY (`menu_set_cd`)
+        )
+*/
+
+@Table(name = "fn_lu_menu_set")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class FnLuMenuSet {
+
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "menu_set_cd", length = 10, nullable = false)
+       @Size(max = 10)
+       @NotNull
+       @SafeHtml
+       private String menuSetCd;
+       @Column(name = "menu_set_name", length = 50, nullable = false)
+       @Size(max = 50)
+       @NotNull
+       @SafeHtml
+       private String menuSetName;
+       @OneToMany(
+               targetEntity = FnMenu.class,
+               mappedBy = "menuSetCd",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<FnMenu> fnMenus = new ArrayList<>();
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLuPriority.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLuPriority.java
new file mode 100644 (file)
index 0000000..1c96abb
--- /dev/null
@@ -0,0 +1,95 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+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.NotNull;
+import javax.validation.constraints.Pattern;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+CREATE TABLE `fn_lu_priority` (
+        `priority_id` decimal(11,0) NOT NULL,
+        `priority` varchar(50) NOT NULL,
+        `active_yn` char(1) NOT NULL,
+        `sort_order` decimal(5,0) DEFAULT NULL,
+        PRIMARY KEY (`priority_id`)
+        )
+*/
+
+@Table(name = "fn_lu_priority")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class FnLuPriority {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "priority_id", nullable = false, length = 11)
+       @Digits(integer = 11, fraction = 0)
+       private Long priority_id;
+       @Column(name = "priority", length = 50, nullable = false)
+       @Size(max = 50)
+       @NotNull
+       @SafeHtml
+       private String priority;
+       @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;
+       @Column(name = "sort_order", nullable = false, length = 5)
+       @Digits(integer = 5, fraction = 0)
+       private Long sortOrder;
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLuRoleType.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLuRoleType.java
new file mode 100644 (file)
index 0000000..63b74c1
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+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.NotNull;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+CREATE TABLE `fn_lu_role_type` (
+        `role_type_id` decimal(11,0) NOT NULL,
+        `role_type` varchar(50) NOT NULL,
+        PRIMARY KEY (`role_type_id`)
+        )
+*/
+
+@Table(name = "fn_lu_role_type")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class FnLuRoleType {
+       @Id
+       @Column(name = "role_type_id", nullable = false, length = 11)
+       @Digits(integer = 11, fraction = 0)
+       private Long role_type_id;
+       @Column(name = "role_type", length = 50, nullable = false)
+       @Size(max = 50)
+       @SafeHtml
+       @NotNull
+       private String roleType;
+
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLuTabSet.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLuTabSet.java
new file mode 100644 (file)
index 0000000..7c9743a
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.Id;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+CREATE TABLE `fn_lu_tab_set` (
+        `tab_set_cd` varchar(30) NOT NULL,
+        `tab_set_name` varchar(50) NOT NULL,
+        PRIMARY KEY (`tab_set_cd`)
+        )
+*/
+
+@Table(name = "fn_lu_tab_set")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class FnLuTabSet {
+       @Id
+       @Column(name = "tab_set_cd", length = 30, nullable = false)
+       @Size(max = 30)
+       @SafeHtml
+       private String tabSetCd;
+       @Column(name = "tab_set_name", length = 50, nullable = false)
+       @Size(max = 50)
+       @SafeHtml
+       @NotNull
+       private String tabSetName;
+       @OneToMany(
+               targetEntity = FnTab.class,
+               mappedBy = "fnLuTabSet",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<FnTab> fnTabs = new ArrayList<>();
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLuTimezone.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLuTimezone.java
new file mode 100644 (file)
index 0000000..b43474f
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+CREATE TABLE `fn_lu_timezone` (
+        `timezone_id` int(11) NOT NULL,
+        `timezone_name` varchar(100) NOT NULL,
+        `timezone_value` varchar(100) NOT NULL,
+        PRIMARY KEY (`timezone_id`)
+        )
+*/
+
+@Table(name = "fn_lu_timezone")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class FnLuTimezone {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "timezone_id", length = 11, nullable = false)
+       private Integer timezoneId;
+       @Column(name = "timezone_name", length = 100, nullable = false)
+       @Size(max = 100)
+       @SafeHtml
+       @NotNull
+       private String timezone_name;
+       @Column(name = "timezone_value", length = 100, nullable = false)
+       @Size(max = 100)
+       @SafeHtml
+       @NotNull
+       private String timezone_value;
+
+       @OneToMany(
+               targetEntity = FnUser.class,
+               mappedBy = "timezone",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<FnUser> fnUsers = new ArrayList<>();
+
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnMenu.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnMenu.java
new file mode 100644 (file)
index 0000000..007d6ed
--- /dev/null
@@ -0,0 +1,175 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.ForeignKey;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Index;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.validation.Valid;
+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;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.hibernate.validator.constraints.URL;
+
+/*
+CREATE TABLE `fn_menu` (
+        `menu_id` int(11) NOT NULL AUTO_INCREMENT,
+        `label` varchar(100) DEFAULT NULL,
+        `parent_id` int(11) DEFAULT NULL,
+        `sort_order` decimal(4,0) DEFAULT NULL,
+        `action` varchar(200) DEFAULT NULL,
+        `function_cd` varchar(30) DEFAULT NULL,
+        `active_yn` varchar(1) NOT NULL DEFAULT 'y',
+        `servlet` varchar(50) DEFAULT NULL,
+        `query_string` varchar(200) DEFAULT NULL,
+        `external_url` varchar(200) DEFAULT NULL,
+        `target` varchar(25) DEFAULT NULL,
+        `menu_set_cd` varchar(10) DEFAULT 'app',
+        `separator_yn` char(1) DEFAULT 'n',
+        `image_src` varchar(100) DEFAULT NULL,
+        PRIMARY KEY (`menu_id`),
+        KEY `fk_fn_menu_ref_196_fn_menu` (`parent_id`),
+        KEY `fk_fn_menu_menu_set_cd` (`menu_set_cd`),
+        KEY `idx_fn_menu_label` (`label`),
+        CONSTRAINT `fk_fn_menu_menu_set_cd` FOREIGN KEY (`menu_set_cd`) REFERENCES `fn_lu_menu_set` (`menu_set_cd`),
+        CONSTRAINT `fk_fn_menu_ref_196_fn_menu` FOREIGN KEY (`parent_id`) REFERENCES `fn_menu` (`menu_id`)
+        )
+*/
+
+@Table(name = "fn_menu", indexes = {
+        @Index(name = "idx_fn_menu_label", columnList = "label"),
+        @Index(name = "fk_fn_menu_ref_196_fn_menu", columnList = "parent_id"),
+        @Index(name = "fk_fn_menu_menu_set_cd", columnList = "menu_set_cd")
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class FnMenu {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "menu_id", nullable = false, length = 11, columnDefinition = "int(11) auto_increment")
+       @Digits(integer = 11, fraction = 0)
+       private Integer menu_id;
+       @Column(name = "label", length = 100, columnDefinition = "varchar(100) DEFAULT NULL")
+       @Size(max = 100)
+       @SafeHtml
+       private String label;
+       @ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
+       @JoinColumn(name = "parent_Id", columnDefinition = "int(11) DEFAULT NULL")
+       @Valid
+       private FnMenu parentId;
+       @Column(name = "sort_order", length = 4, columnDefinition = "decimal(4,0) DEFAULT NULL")
+       @Digits(integer = 4, fraction = 0)
+       private Integer sortOrder;
+       @Column(name = "action", length = 200, columnDefinition = "varchar(200) DEFAULT NULL")
+       @Size(max = 200)
+       @SafeHtml
+       private String action;
+       @Column(name = "function_cd", length = 30, columnDefinition = "varchar(30) DEFAULT NULL")
+       @Size(max = 30)
+       @SafeHtml
+       private String functionCd;
+       @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;
+       @Column(name = "servlet", length = 50, columnDefinition = "varchar(50) DEFAULT NULL")
+       @Size(max = 50)
+       @SafeHtml
+       private String servlet;
+       @Column(name = "query_string", length = 200, columnDefinition = "varchar(200) DEFAULT NULL")
+       @Size(max = 200)
+       @SafeHtml
+       private String queryString;
+       @Column(name = "external_url", length = 200, columnDefinition = "varchar(200) DEFAULT NULL")
+       @Size(max = 200)
+       @SafeHtml
+       @URL
+       //TODO url
+       private String externalUrl;
+       @Column(name = "target", length = 25, columnDefinition = "varchar(25) DEFAULT NULL")
+       @Size(max = 25)
+       @SafeHtml
+       private String target;
+       @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+       @JoinColumn(name = "menu_set_cd", columnDefinition = "character varying(10) default 'app'", foreignKey = @ForeignKey(name = "fk_fn_menu_menu_set_cd"))
+       @Valid
+       private FnLuMenuSet menuSetCd;
+       @Column(name = "separator_yn", length = 1, columnDefinition = "character varying(1) default 'n'")
+       @Pattern(regexp = "[YNyn]")
+       @Size(max = 1)
+       @NotNull
+       @SafeHtml
+       private String separatorYn;
+       @Column(name = "image_src", length = 100, columnDefinition = "varchar(100) DEFAULT NULL")
+       @Size(max = 100)
+       @SafeHtml
+       private String imageSrc;
+       @OneToMany(
+               targetEntity = FnMenu.class,
+               mappedBy = "parentId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<FnMenu> fnMenus = new ArrayList<>();
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnMenuFunctional.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnMenuFunctional.java
new file mode 100644 (file)
index 0000000..bfdc673
--- /dev/null
@@ -0,0 +1,159 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Index;
+import javax.persistence.JoinColumn;
+import javax.persistence.JoinTable;
+import javax.persistence.ManyToMany;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.validation.Valid;
+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;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.hibernate.validator.constraints.URL;
+
+/*
+CREATE TABLE `fn_menu_functional` (
+  `menu_id` int(11) NOT NULL AUTO_INCREMENT,
+  `column_num` int(2) NOT NULL,
+  `text` varchar(100) NOT NULL,
+  `parent_menu_id` int(11) DEFAULT NULL,
+  `url` varchar(128) NOT NULL DEFAULT '',
+  `active_yn` varchar(1) NOT NULL DEFAULT 'y',
+  `image_src` varchar(100) DEFAULT NULL,
+  PRIMARY KEY (`menu_id`),
+  KEY `fk_fn_menu_func_parent_menu_id_idx` (`parent_menu_id`),
+  CONSTRAINT `fk_fn_menu_func_parent_menu_id` FOREIGN KEY (`parent_menu_id`) REFERENCES `fn_menu_functional` (`menu_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
+)
+*/
+
+@Table(name = "fn_menu_functional", indexes = {@Index(columnList = "parent_menu_id", name = "fk_fn_menu_func_parent_menu_id_idx")
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class FnMenuFunctional {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "menu_id", nullable = false, length = 11)
+       @Digits(integer = 11, fraction = 0)
+       private Long menuId;
+       @Column(name = "column_num", nullable = false, length = 2)
+       @Digits(integer = 2, fraction = 0)
+       private Long columnNum;
+       @Column(name = "text", length = 100, nullable = false)
+       @Size(max = 100)
+       @SafeHtml
+       @NotNull
+       private String text;
+       @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+       @JoinColumn(name = "parent_menu_id")
+       @Valid
+       private FnMenuFunctional parentMenuId;
+       @Column(name = "url", length = 128, nullable = false, columnDefinition = "varchar(128) default ''")
+       @Size(max = 128)
+       @SafeHtml
+       @NotNull
+       //TODO URL
+       @URL
+       private String url;
+       @Column(name = "active_yn", length = 1, columnDefinition = "varchar(1) default 'Y'", nullable = false)
+       @Pattern(regexp = "[YNyn]")
+       @Size(max = 1)
+       @NotNull
+       @SafeHtml
+       private String activeYn;
+       @Column(name = "image_src", length = 100, columnDefinition = "varchar(100) default null")
+       @Size(max = 100)
+       @SafeHtml
+       private String imageSrc;
+       @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+       @JoinTable(
+               name = "fn_menu_favorites",
+               joinColumns = {@JoinColumn(name = "menu_id", referencedColumnName = "menu_id")},
+               inverseJoinColumns = {@JoinColumn(name = "role_Id", referencedColumnName = "user_id")},
+               indexes = {
+                       @Index(name = "sys_c0014619", columnList = "menu_id")
+               }
+       )
+       private List<FnUser> fnUsers = new ArrayList<>();
+       @OneToMany(
+               targetEntity = FnMenuFunctionalAncestors.class,
+               mappedBy = "menuId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<FnMenuFunctionalAncestors> fnMenuFunctionalAncestorsMenuId = new ArrayList<>();
+       @OneToMany(
+               targetEntity = FnMenuFunctionalAncestors.class,
+               mappedBy = "ancestorMenuId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<FnMenuFunctionalAncestors> fnMenuFunctionalsAncestorMenuId = new ArrayList<>();
+       @OneToMany(
+               targetEntity = FnMenuFunctionalRoles.class,
+               mappedBy = "menuId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<FnMenuFunctionalRoles> fnMenuFunctionalRoles = new ArrayList<>();
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnMenuFunctionalAncestors.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnMenuFunctionalAncestors.java
new file mode 100644 (file)
index 0000000..5dd037f
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Index;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotNull;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+/*
+CREATE TABLE `fn_menu_functional_ancestors` (
+        `id` int(11) NOT NULL AUTO_INCREMENT,
+        `menu_id` int(11) NOT NULL,
+        `ancestor_menu_id` int(11) NOT NULL,
+        `depth` int(2) NOT NULL,
+        PRIMARY KEY (`id`),
+        KEY `fk_fn_menu_func_anc_menu_id_idx` (`menu_id`),
+        KEY `fk_fn_menu_func_anc_anc_menu_id_idx` (`ancestor_menu_id`),
+        CONSTRAINT `fk_fn_menu_func_anc_anc_menu_id` FOREIGN KEY (`ancestor_menu_id`) REFERENCES `fn_menu_functional` (`menu_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
+        CONSTRAINT `fk_fn_menu_func_anc_menu_id` FOREIGN KEY (`menu_id`) REFERENCES `fn_menu_functional` (`menu_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
+        )
+*/
+
+@Table(name = "fn_menu_functional_ancestors", indexes = {
+        @Index(columnList = "menu_id", name = "fk_fn_menu_func_anc_menu_id_idx"),
+        @Index(columnList = "ancestor_menu_id", name = "fk_fn_menu_func_anc_anc_menu_id_idx")
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class FnMenuFunctionalAncestors {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "id", nullable = false, length = 11, columnDefinition = "int(11)  AUTO_INCREMENT")
+       @Digits(integer = 11, fraction = 0)
+       private Integer id;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "menu_id", nullable = false)
+       @NotNull
+       private FnMenuFunctional menuId;
+       @ManyToOne(fetch = FetchType.LAZY, cascade =CascadeType.ALL)
+       @JoinColumn(name = "ancestor_menu_id", nullable = false)
+       @NotNull
+       private FnMenuFunctional ancestorMenuId;
+       @Column(name = "depth", nullable = false, length = 2)
+       @Digits(integer = 2, fraction = 0)
+       @NotNull
+       private Integer depth;
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnMenuFunctionalRoles.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnMenuFunctionalRoles.java
new file mode 100644 (file)
index 0000000..c1ed751
--- /dev/null
@@ -0,0 +1,110 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Index;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.validation.Valid;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotNull;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+/*
+CREATE TABLE `fn_menu_functional_roles` (
+        `id` int(11) NOT NULL AUTO_INCREMENT,
+        `menu_id` int(11) NOT NULL,
+        `app_id` int(11) NOT NULL,
+        `role_id` int(10) NOT NULL,
+        PRIMARY KEY (`id`),
+        KEY `fk_fn_menu_func_roles_menu_id_idx` (`menu_id`),
+        KEY `fk_fn_menu_func_roles_app_id_idx` (`app_id`),
+        KEY `fk_fn_menu_func_roles_role_id_idx` (`role_id`),
+        CONSTRAINT `fk_fn_menu_func_roles_app_id` FOREIGN KEY (`app_id`) REFERENCES `fn_app` (`app_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
+        CONSTRAINT `fk_fn_menu_func_roles_menu_id` FOREIGN KEY (`menu_id`) REFERENCES `fn_menu_functional` (`menu_id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
+        CONSTRAINT `fk_fn_menu_func_roles_role_id` FOREIGN KEY (`role_id`) REFERENCES `fn_role` (`role_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
+        )
+*/
+
+@Table(name = "fn_menu_functional_roles", indexes = {
+        @Index(columnList = "menu_id", name = "fk_fn_menu_func_roles_menu_id_idx"),
+        @Index(columnList = "app_id", name = "fk_fn_menu_func_roles_app_id_idx"),
+        @Index(columnList = "role_id", name = "fk_fn_menu_func_roles_role_id_idx")
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class FnMenuFunctionalRoles {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "id", nullable = false, length = 11, columnDefinition = "int(11) AUTO_INCREMENT")
+       @Digits(integer = 11, fraction = 0)
+       private Long id;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "menu_id", nullable = false)
+       @Valid
+       @NotNull
+       private FnMenuFunctional menuId;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "role_id", nullable = false)
+       @Valid
+       @NotNull
+       private FnRole roleId;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "app_Id", nullable = false)
+       @Valid
+       @NotNull
+       private FnApp appId;
+
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnOrg.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnOrg.java
new file mode 100644 (file)
index 0000000..44a5e84
--- /dev/null
@@ -0,0 +1,107 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Index;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import lombok.ToString;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+CREATE TABLE `fn_org` (
+        `org_id` int(11) NOT NULL,
+        `org_name` varchar(50) NOT NULL,
+        `access_cd` varchar(10) DEFAULT NULL,
+        PRIMARY KEY (`org_id`),
+        KEY `fn_org_access_cd` (`access_cd`) USING BTREE
+        )
+*/
+
+@Table(name = "fn_org", indexes = {
+        @Index(name = "fn_org_access_cd", columnList = "access_cd")
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@ToString
+@Getter
+@Setter
+@Entity
+public class FnOrg {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "org_id", nullable = false, length = 11)
+       @Digits(integer = 11, fraction = 0)
+       private Integer orgId;
+       @Column(name = "org_name", length = 50, nullable = false)
+       @Size(max = 50)
+       @SafeHtml
+       @NotNull
+       private String orgName;
+       @Column(name = "access_cd", length = 10, columnDefinition = "varchar(10) DEFAULT NULL")
+       @Size(max = 10)
+       @SafeHtml
+       private String accessCd;
+
+       @OneToMany(
+               targetEntity = FnUser.class,
+               mappedBy = "orgId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<FnUser> fnUsers = new ArrayList<>();
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnPersUserAppSel.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnPersUserAppSel.java
new file mode 100644 (file)
index 0000000..8aead52
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Index;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.validation.Valid;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.onap.portal.domain.dto.DomainVo;
+
+/*
+CREATE TABLE `fn_pers_user_app_sel` (
+        `id` int(11) NOT NULL AUTO_INCREMENT,
+        `user_id` int(11) NOT NULL,
+        `app_id` int(11) NOT NULL,
+        `status_cd` char(1) NOT NULL,
+        PRIMARY KEY (`id`),
+        KEY `fk_1_fn_pers_user_app_sel_fn_user` (`user_id`),
+        KEY `fk_2_fn_pers_user_app_sel_fn_app` (`app_id`),
+        CONSTRAINT `fk_1_fn_pers_user_app_sel_fn_user` FOREIGN KEY (`user_id`) REFERENCES `fn_user` (`user_id`),
+        CONSTRAINT `fk_2_fn_pers_user_app_sel_fn_app` FOREIGN KEY (`app_id`) REFERENCES `fn_app` (`app_id`)
+        )
+*/
+
+@Table(name = "fn_pers_user_app_sel", indexes = {
+        @Index(name = "fk_1_fn_pers_user_app_sel_fn_user", columnList = "user_id"),
+        @Index(name = "fk_2_fn_pers_user_app_sel_fn_app", columnList = "app_id")
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class FnPersUserAppSel extends DomainVo {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "id", length = 11, nullable = false, columnDefinition = "int(11) AUTO_INCREMENT")
+       @Digits(integer = 11, fraction = 0)
+       private Long id;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "user_id", nullable = false)
+       @NotNull
+       @Valid
+       private FnUser userId;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "app_id", nullable = false)
+       @Valid
+       private FnApp appId;
+       @Column(name = "status_cd", length = 1, nullable = false)
+       @Size(max = 1)
+       @NotNull
+       @SafeHtml
+       private String statusCd;
+
+       public FnPersUserAppSel(final Long id, final Long userId, final Long appId, final String statusCode) {
+              super.id = id;
+              this.userId.setUserId(userId);
+              this.appId.setAppId(appId);
+              this.statusCd = statusCode;
+       }
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzBlobTriggers.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzBlobTriggers.java
new file mode 100644 (file)
index 0000000..b817a19
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.Index;
+import javax.persistence.JoinColumn;
+import javax.persistence.JoinColumns;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.onap.portal.domain.db.fn.compositePK.FnQzTriggersId;
+
+/*
+CREATE TABLE `fn_qz_blob_triggers` (
+        `SCHED_NAME` varchar(120) NOT NULL,
+        `TRIGGER_NAME` varchar(200) NOT NULL,
+        `TRIGGER_GROUP` varchar(200) NOT NULL,
+        `BLOB_DATA` blob DEFAULT NULL,
+        PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
+        KEY `SCHED_NAME` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
+        CONSTRAINT `fn_qz_blob_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `fn_qz_triggers` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`)
+        )
+*/
+
+@Table(name = "fn_qz_blob_triggers", indexes = {
+        @Index(columnList = "SCHED_NAME, TRIGGER_NAME, TRIGGER_GROUP")
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode
+@Getter
+@Setter
+@Entity
+@IdClass(FnQzTriggersId.class)
+public class FnQzBlobTriggers {
+       @Id
+       @ManyToOne
+       @JoinColumns(value = {
+               @JoinColumn(name = "SCHED_NAME", referencedColumnName = "SCHED_NAME"),
+               @JoinColumn(name = "TRIGGER_NAME", referencedColumnName = "TRIGGER_NAME"),
+               @JoinColumn(name = "TRIGGER_GROUP", referencedColumnName = "TRIGGER_GROUP")
+       })
+       @NotNull
+       private FnQzTriggers fnQzTriggers;
+       @Id
+       @Valid
+       @Column(name = "SCHED_NAME", length = 120, insertable = false, updatable = false)
+       private String schedName;
+       @Id
+       @Column(name = "TRIGGER_NAME", length = 200, nullable = false, insertable = false, updatable = false)
+       @Size(max = 200)
+       @SafeHtml
+       private String triggerName;
+       @Id
+       @Column(name = "TRIGGER_GROUP", length = 200, nullable = false, insertable = false, updatable = false)
+       @Size(max = 200)
+       @SafeHtml
+       private String triggerGroup;
+       @Column(name = "BLOB_DATA",columnDefinition = "blob DEFAULT NULL")
+       private byte[] blobData;
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzCalendars.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzCalendars.java
new file mode 100644 (file)
index 0000000..f901474
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import java.io.Serializable;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.Table;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.onap.portal.domain.db.fn.FnQzCalendars.FnQzCalendarsId;
+
+/*
+CREATE TABLE `fn_qz_calendars` (
+        `SCHED_NAME` varchar(120) NOT NULL,
+        `CALENDAR_NAME` varchar(200) NOT NULL,
+        `CALENDAR` blob NOT NULL,
+        PRIMARY KEY (`SCHED_NAME`,`CALENDAR_NAME`)
+        )
+*/
+
+@Table(name = "fn_qz_calendars")
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode
+@Getter
+@Setter
+@Entity
+@IdClass(FnQzCalendarsId.class)
+public class FnQzCalendars {
+       @Id
+       @SafeHtml
+       @Column(name = "SCHED_NAME", length = 120, insertable = false, updatable = false)
+       @Size(max = 120)
+       @NotNull
+       private String schedName;
+       @Id
+       @SafeHtml
+       @Column(name = "CALENDAR_NAME", length = 200, insertable = false, updatable = false)
+       @Size(max = 200)
+       @NotNull
+       private String calendarName;
+       @Column(name = "CALENDAR", nullable = false, columnDefinition = "BLOB")
+       @NotNull
+       private byte[] calendar;
+
+       @Getter
+       @Setter
+       @NoArgsConstructor
+       @EqualsAndHashCode
+       @AllArgsConstructor
+       public static class FnQzCalendarsId implements Serializable {
+              private String schedName;
+              private String calendarName;
+       }
+}
+
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzCronTriggers.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzCronTriggers.java
new file mode 100644 (file)
index 0000000..21ae8dd
--- /dev/null
@@ -0,0 +1,113 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.JoinColumn;
+import javax.persistence.JoinColumns;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.onap.portal.domain.db.fn.compositePK.FnQzTriggersId;
+
+/*
+CREATE TABLE `fn_qz_cron_triggers` (
+        `SCHED_NAME` varchar(120) NOT NULL,
+        `TRIGGER_NAME` varchar(200) NOT NULL,
+        `TRIGGER_GROUP` varchar(200) NOT NULL,
+        `CRON_EXPRESSION` varchar(120) NOT NULL,
+        `TIME_ZONE_ID` varchar(80) DEFAULT NULL,
+        PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
+        CONSTRAINT `fn_qz_cron_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `fn_qz_triggers` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`)
+        )
+*/
+
+@Table(name = "fn_qz_cron_triggers")
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode
+@Getter
+@Setter
+@Entity
+@IdClass(FnQzTriggersId.class)
+public class FnQzCronTriggers {
+       @Id
+       @ManyToOne
+       @JoinColumns(value = {
+               @JoinColumn(name = "SCHED_NAME", referencedColumnName = "SCHED_NAME"),
+               @JoinColumn(name = "TRIGGER_NAME", referencedColumnName = "TRIGGER_NAME"),
+               @JoinColumn(name = "TRIGGER_GROUP", referencedColumnName = "TRIGGER_GROUP")
+       })
+       private FnQzTriggers fnQzTriggers;
+       @Id
+       @SafeHtml
+       @Column(name = "SCHED_NAME", length = 120, insertable = false, updatable = false)
+       private String schedName;
+       @Id
+       @Column(name = "TRIGGER_NAME", length = 200, nullable = false, insertable = false, updatable = false)
+       @Size(max = 200)
+       @SafeHtml
+       private String triggerName;
+       @Id
+       @Column(name = "TRIGGER_GROUP", length = 200, nullable = false, insertable = false, updatable = false)
+       @Size(max = 200)
+       @SafeHtml
+       private String triggerGroup;
+       @Column(name = "CRON_EXPRESSION", length = 120, nullable = false)
+       @Size(max = 120)
+       @SafeHtml
+       @NotNull
+       private String cronExpression;
+       @Column(name = "TIME_ZONE_ID", length = 80, columnDefinition = "varchar(80) DEFAULT NULL")
+       @Size(max = 80)
+       @SafeHtml
+       private String timeZoneId;
+}
\ No newline at end of file
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzFiredTriggers.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzFiredTriggers.java
new file mode 100644 (file)
index 0000000..7039437
--- /dev/null
@@ -0,0 +1,175 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import java.io.Serializable;
+import java.math.BigInteger;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.Index;
+import javax.persistence.Table;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.onap.portal.domain.db.fn.FnQzFiredTriggers.FnQzFiredTriggersID;
+
+/*
+CREATE TABLE `fn_qz_fired_triggers` (
+        `SCHED_NAME` varchar(120) NOT NULL,
+        `ENTRY_ID` varchar(95) NOT NULL,
+        `TRIGGER_NAME` varchar(200) NOT NULL,
+        `TRIGGER_GROUP` varchar(200) NOT NULL,
+        `INSTANCE_NAME` varchar(200) NOT NULL,
+        `FIRED_TIME` bigint(13) NOT NULL,
+        `SCHED_TIME` bigint(13) NOT NULL,
+        `PRIORITY` int(11) NOT NULL,
+        `STATE` varchar(16) NOT NULL,
+        `JOB_NAME` varchar(200) DEFAULT NULL,
+        `JOB_GROUP` varchar(200) DEFAULT NULL,
+        `IS_NONCONCURRENT` varchar(1) DEFAULT NULL,
+        `REQUESTS_RECOVERY` varchar(1) DEFAULT NULL,
+        PRIMARY KEY (`SCHED_NAME`,`ENTRY_ID`),
+        KEY `idx_fn_qz_ft_trig_inst_name` (`SCHED_NAME`,`INSTANCE_NAME`),
+        KEY `idx_fn_qz_ft_inst_job_req_rcvry` (`SCHED_NAME`,`INSTANCE_NAME`,`REQUESTS_RECOVERY`),
+        KEY `idx_fn_qz_ft_j_g` (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`),
+        KEY `idx_fn_qz_ft_jg` (`SCHED_NAME`,`JOB_GROUP`),
+        KEY `idx_fn_qz_ft_t_g` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
+        KEY `idx_fn_qz_ft_tg` (`SCHED_NAME`,`TRIGGER_GROUP`)
+        )
+*/
+
+@Table(name = "fn_qz_fired_triggers", indexes = {
+        @Index(name = "idx_fn_qz_ft_trig_inst_name", columnList = "sched_name, instance_name"),
+        @Index(name = "idx_fn_qz_ft_inst_job_req_rcvry", columnList = "sched_name, instance_name, requests_recovery"),
+        @Index(name = "idx_fn_qz_ft_j_g", columnList = "sched_name, job_name, job_group"),
+        @Index(name = "idx_fn_qz_ft_jg", columnList = "sched_name, job_group"),
+        @Index(name = "idx_fn_qz_ft_t_g", columnList = "sched_name, trigger_name, trigger_group"),
+        @Index(name = "idx_fn_qz_ft_tg", columnList = "sched_name, trigger_group")
+
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode
+@Getter
+@Setter
+@Entity
+@IdClass(FnQzFiredTriggersID.class)
+public class FnQzFiredTriggers {
+       @Id
+       @Size(max = 120)
+       @SafeHtml
+       @Column(name = "SCHED_NAME", length = 120, nullable = false)
+       private String schedName;
+       @Id
+       @Size(max = 95)
+       @SafeHtml
+       @Column(name = "ENTRY_ID", length = 95, nullable = false)
+       private String entryId;
+       @Column(name = "TRIGGER_NAME", length = 200, nullable = false)
+       @Size(max = 200)
+       @SafeHtml
+       @NotNull
+       private String triggerName;
+       @Column(name = "TRIGGER_GROUP", length = 200, nullable = false)
+       @Size(max = 200)
+       @SafeHtml
+       @NotNull
+       private String triggerGroup;
+       @Column(name = "INSTANCE_NAME", length = 200, nullable = false)
+       @Size(max = 200)
+       @SafeHtml
+       @NotNull
+       private String instanceName;
+       @Column(name = "FIRED_TIME", length = 13, nullable = false)
+       @Digits(integer = 13, fraction = 0)
+       @NotNull
+       private BigInteger firedTime;
+       @Column(name = "SCHED_TIME", length = 13, nullable = false)
+       @Digits(integer = 13, fraction = 0)
+       @NotNull
+       private BigInteger schedTime;
+       @Column(name = "PRIORITY", nullable = false)
+       @NotNull
+       private Integer priority;
+       @Column(name = "STATE", length = 16, nullable = false)
+       @Size(max = 16)
+       @SafeHtml
+       @NotNull
+       private String state;
+       @Column(name = "JOB_NAME", length = 200, columnDefinition = "varchar(200) DEFAULT NULL")
+       @Size(max = 200)
+       @SafeHtml
+       private String jobName;
+       @Column(name = "JOB_GROUP", length = 200, columnDefinition = "varchar(200) DEFAULT NULL")
+       @Size(max = 200)
+       @SafeHtml
+       private String jobGroup;
+       @Column(name = "IS_NONCONCURRENT", length = 1, columnDefinition = "varchar(1) DEFAULT NULL")
+       @Size(max = 1)
+       @SafeHtml
+       private String isNonconcurrent;
+       @Column(name = "REQUESTS_RECOVERY", length = 1, columnDefinition = "varchar(1) DEFAULT NULL")
+       @Size(max = 1)
+       @SafeHtml
+       private String requestsRecovery;
+
+       @Getter
+       @Setter
+       @NoArgsConstructor
+       @EqualsAndHashCode
+       @AllArgsConstructor
+       public static class FnQzFiredTriggersID implements Serializable {
+              @Size(max = 120)
+              @SafeHtml
+              private String schedName;
+              @Size(max = 95)
+              @SafeHtml
+              private String entryId;
+       }
+}
\ No newline at end of file
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzJobDetails.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzJobDetails.java
new file mode 100644 (file)
index 0000000..11ab511
--- /dev/null
@@ -0,0 +1,167 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.Index;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.onap.portal.domain.db.fn.FnQzJobDetails.FnQzJobDetailsID;
+
+/*
+CREATE TABLE `fn_qz_job_details` (
+        `SCHED_NAME` varchar(120) NOT NULL,
+        `JOB_NAME` varchar(200) NOT NULL,
+        `JOB_GROUP` varchar(200) NOT NULL,
+        `DESCRIPTION` varchar(250) DEFAULT NULL,
+        `JOB_CLASS_NAME` varchar(250) NOT NULL,
+        `IS_DURABLE` varchar(1) NOT NULL,
+        `IS_NONCONCURRENT` varchar(1) NOT NULL,
+        `IS_UPDATE_DATA` varchar(1) NOT NULL,
+        `REQUESTS_RECOVERY` varchar(1) NOT NULL,
+        `JOB_DATA` blob DEFAULT NULL,
+        PRIMARY KEY (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`),
+        KEY `idx_fn_qz_j_req_recovery` (`SCHED_NAME`,`REQUESTS_RECOVERY`),
+        KEY `idx_fn_qz_j_grp` (`SCHED_NAME`,`JOB_GROUP`)
+        )
+*/
+
+@Table(name = "fn_qz_job_details", indexes = {
+        @Index(name = "idx_fn_qz_j_req_recovery", columnList = "sched_name,requests_recovery"),
+        @Index(name = "idx_fn_qz_j_grp", columnList = "sched_name, job_group")
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode
+@Getter
+@Setter
+@Entity
+@IdClass(FnQzJobDetailsID.class)
+public class FnQzJobDetails {
+       @Id
+       @SafeHtml
+       @Size(max = 120)
+       @Column(name = "SCHED_NAME", length = 120)
+       private String schedName;
+       @Id
+       @SafeHtml
+       @Size(max = 200)
+       @Column(name = "JOB_NAME", length = 200)
+       private String jobName;
+       @Id
+       @SafeHtml
+       @Size(max = 200)
+       @Column(name = "JOB_GROUP", length = 200)
+       private String jobGroup;
+       @Column(name = "DESCRIPTION", length = 250, columnDefinition = "varchar(250) DEFAULT NULL")
+       @Size(max = 250)
+       @SafeHtml
+       private String description;
+       @Column(name = "JOB_CLASS_NAME", length = 250, nullable = false)
+       @Size(max = 250)
+       @SafeHtml
+       @NotNull
+       private String jobClassName;
+       @Column(name = "IS_DURABLE", length = 1, nullable = false)
+       @Size(max = 1)
+       @SafeHtml
+       @NotNull
+       private String isDurable;
+       @Column(name = "IS_NONCONCURRENT", length = 1, nullable = false)
+       @Size(max = 1)
+       @SafeHtml
+       @NotNull
+       private String isNonconcurrent;
+       @Column(name = "IS_UPDATE_DATA", length = 1, nullable = false)
+       @Size(max = 1)
+       @SafeHtml
+       @NotNull
+       private String isUpdateData;
+       @Column(name = "REQUESTS_RECOVERY", length = 1, nullable = false)
+       @Size(max = 1)
+       @SafeHtml
+       @NotNull
+       private String requestsRecovery;
+       @Column(name = "JOB_DATA", columnDefinition = "blob DEFAULT NULL")
+       private byte[] jobData;
+
+       @OneToMany(
+               targetEntity = FnQzTriggers.class,
+               mappedBy = "fnQzJobDetails",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<FnQzTriggers> selectedTabCd = new ArrayList<>();
+
+       @Getter
+       @Setter
+       @NoArgsConstructor
+       @EqualsAndHashCode
+       @AllArgsConstructor
+       public static class FnQzJobDetailsID implements Serializable {
+              @Size(max = 120)
+              @SafeHtml
+              private String schedName;
+              @Size(max = 200)
+              @SafeHtml
+              private String jobName;
+              @Size(max = 200)
+              @SafeHtml
+              private String jobGroup;
+       }
+
+}
\ No newline at end of file
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzLocks.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzLocks.java
new file mode 100644 (file)
index 0000000..1d9fc48
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import java.io.Serializable;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.Table;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.onap.portal.domain.db.fn.FnQzLocks.FnQzLocksID;
+
+/*
+CREATE TABLE `fn_qz_locks` (
+        `SCHED_NAME` varchar(120) NOT NULL,
+        `LOCK_NAME` varchar(40) NOT NULL,
+        PRIMARY KEY (`SCHED_NAME`,`LOCK_NAME`)
+        )
+*/
+
+@Table(name = "fn_qz_locks")
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode
+@Getter
+@Setter
+@Entity
+@IdClass(FnQzLocksID.class)
+public class FnQzLocks {
+       @Id
+       @Size(max = 120)
+       @SafeHtml
+       @Column(name = "SCHED_NAME", length = 120, nullable = false)
+       private String schedName;
+       @Id
+       @Size(max = 40)
+       @SafeHtml
+       @Column(name = "LOCK_NAME", length = 40, nullable = false)
+       private String lockName;
+
+       @Getter
+       @Setter
+       @NoArgsConstructor
+       @EqualsAndHashCode
+       @AllArgsConstructor
+       public static class FnQzLocksID implements Serializable {
+              @Size(max = 120)
+              @SafeHtml
+              private String schedName;
+              @Size(max = 40)
+              @SafeHtml
+              private String lockName;
+       }
+}
\ No newline at end of file
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzPausedTriggerGrps.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzPausedTriggerGrps.java
new file mode 100644 (file)
index 0000000..a7bcdb3
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import java.io.Serializable;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.Table;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.onap.portal.domain.db.fn.FnQzPausedTriggerGrps.FnQzPausedTriggerGrpsID;
+
+/*
+CREATE TABLE `fn_qz_paused_trigger_grps` (
+        `SCHED_NAME` varchar(120) NOT NULL,
+        `TRIGGER_GROUP` varchar(200) NOT NULL,
+        PRIMARY KEY (`SCHED_NAME`,`TRIGGER_GROUP`)
+        )
+*/
+
+@Table(name = "fn_qz_paused_trigger_grps")
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode
+@Getter
+@Setter
+@Entity
+@IdClass(FnQzPausedTriggerGrpsID.class)
+public class FnQzPausedTriggerGrps {
+       @Id
+       @Size(max = 120)
+       @SafeHtml
+       @Column(name = "SCHED_NAME", length = 120, nullable = false)
+       private String schedName;
+       @Id
+       @Size(max = 120)
+       @SafeHtml
+       @Column(name = "TRIGGER_GROUP", length = 200, nullable = false)
+       private String triggerGroup;
+
+       @Getter
+       @Setter
+       @NoArgsConstructor
+       @EqualsAndHashCode
+       @AllArgsConstructor
+       public static class FnQzPausedTriggerGrpsID implements Serializable {
+              @Size(max = 120)
+              @SafeHtml
+              private String schedName;
+              @Size(max = 120)
+              @SafeHtml
+              private String triggerGroup;
+       }
+}
\ No newline at end of file
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzSchedulerState.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzSchedulerState.java
new file mode 100644 (file)
index 0000000..e19c216
--- /dev/null
@@ -0,0 +1,113 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import java.io.Serializable;
+import java.math.BigInteger;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.Table;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.onap.portal.domain.db.fn.FnQzSchedulerState.FnQzSchedulerStateID;
+
+/*
+CREATE TABLE `fn_qz_scheduler_state` (
+        `SCHED_NAME` varchar(120) NOT NULL,
+        `INSTANCE_NAME` varchar(200) NOT NULL,
+        `LAST_CHECKIN_TIME` bigint(13) NOT NULL,
+        `CHECKIN_INTERVAL` bigint(13) NOT NULL,
+        PRIMARY KEY (`SCHED_NAME`,`INSTANCE_NAME`)
+        )
+*/
+
+@Table(name = "fn_qz_scheduler_state")
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode
+@Getter
+@Setter
+@Entity
+@IdClass(FnQzSchedulerStateID.class)
+public class FnQzSchedulerState {
+       @Id
+       @Size(max = 120)
+       @SafeHtml
+       @Column(name = "SCHED_NAME", length = 120, nullable = false)
+       private String schedName;
+       @Id
+       @Size(max = 200)
+       @SafeHtml
+       @Column(name = "INSTANCE_NAME", length = 200, nullable = false)
+       private String instanceName;
+       @Column(name = "LAST_CHECKIN_TIME", length = 13, nullable = false)
+       @Digits(integer = 13, fraction = 0)
+       @NotNull
+       private BigInteger lastCheckinTime;
+       @Column(name = "CHECKIN_INTERVAL", length = 13, nullable = false)
+       @Digits(integer = 13, fraction = 0)
+       @NotNull
+       private BigInteger checkinInterval;
+
+
+       @Getter
+       @Setter
+       @NoArgsConstructor
+       @EqualsAndHashCode
+       @AllArgsConstructor
+       public static class FnQzSchedulerStateID implements Serializable {
+              @Size(max = 120)
+              @SafeHtml
+              private String schedName;
+              @Size(max = 200)
+              @SafeHtml
+              private String instanceName;
+       }
+}
\ No newline at end of file
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzSimpleTriggers.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzSimpleTriggers.java
new file mode 100644 (file)
index 0000000..f3f9a94
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.JoinColumn;
+import javax.persistence.JoinColumns;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.validation.Valid;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.onap.portal.domain.db.fn.compositePK.FnQzTriggersId;
+
+/*
+CREATE TABLE `fn_qz_simple_triggers` (
+        `SCHED_NAME` varchar(120) NOT NULL,
+        `TRIGGER_NAME` varchar(200) NOT NULL,
+        `TRIGGER_GROUP` varchar(200) NOT NULL,
+        `REPEAT_COUNT` bigint(7) NOT NULL,
+        `REPEAT_INTERVAL` bigint(12) NOT NULL,
+        `TIMES_TRIGGERED` bigint(10) NOT NULL,
+        PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
+        CONSTRAINT `fn_qz_simple_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `fn_qz_triggers` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`)
+        )
+*/
+
+@Table(name = "fn_qz_simple_triggers")
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode
+@Getter
+@Setter
+@Entity
+@IdClass(FnQzTriggersId.class)
+public class FnQzSimpleTriggers {
+       @Id
+       @ManyToOne
+       @JoinColumns(value = {
+               @JoinColumn(name = "SCHED_NAME", referencedColumnName = "SCHED_NAME"),
+               @JoinColumn(name = "TRIGGER_NAME", referencedColumnName = "TRIGGER_NAME"),
+               @JoinColumn(name = "TRIGGER_GROUP", referencedColumnName = "TRIGGER_GROUP")
+       })
+       private FnQzTriggers fnQzTriggers;
+       @Id
+       @Valid
+       @Column(name = "SCHED_NAME", length = 120, insertable = false, updatable = false)
+       private String schedName;
+       @Id
+       @Column(name = "TRIGGER_NAME", length = 200, nullable = false, insertable = false, updatable = false)
+       @Size(max = 200)
+       @SafeHtml
+       private String triggerName;
+       @Id
+       @Column(name = "TRIGGER_GROUP", length = 200, nullable = false, insertable = false, updatable = false)
+       @Size(max = 200)
+       @SafeHtml
+       private String triggerGroup;
+       @Column(name = "REPEAT_COUNT", length = 7, nullable = false)
+       @Digits(integer = 7, fraction = 0)
+       @NotNull
+       private Long repeatCount;
+       @Column(name = "REPEAT_INTERVAL", length = 12, nullable = false)
+       @Digits(integer = 12, fraction = 0)
+       @NotNull
+       private Long repeatInterval;
+       @Column(name = "TIMES_TRIGGERED", length = 10, nullable = false)
+       @Digits(integer = 10, fraction = 0)
+       @NotNull
+       private Long timesTriggered;
+
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzSimpropTriggers.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzSimpropTriggers.java
new file mode 100644 (file)
index 0000000..cef8f48
--- /dev/null
@@ -0,0 +1,152 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.JoinColumn;
+import javax.persistence.JoinColumns;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.validation.Valid;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.onap.portal.domain.db.fn.compositePK.FnQzTriggersId;
+
+/*
+CREATE TABLE `fn_qz_simprop_triggers` (
+        `SCHED_NAME` varchar(120) NOT NULL,
+        `TRIGGER_NAME` varchar(200) NOT NULL,
+        `TRIGGER_GROUP` varchar(200) NOT NULL,
+        `STR_PROP_1` varchar(512) DEFAULT NULL,
+        `STR_PROP_2` varchar(512) DEFAULT NULL,
+        `STR_PROP_3` varchar(512) DEFAULT NULL,
+        `INT_PROP_1` int(11) DEFAULT NULL,
+        `INT_PROP_2` int(11) DEFAULT NULL,
+        `LONG_PROP_1` bigint(20) DEFAULT NULL,
+        `LONG_PROP_2` bigint(20) DEFAULT NULL,
+        `DEC_PROP_1` decimal(13,4) DEFAULT NULL,
+        `DEC_PROP_2` decimal(13,4) DEFAULT NULL,
+        `BOOL_PROP_1` varchar(1) DEFAULT NULL,
+        `BOOL_PROP_2` varchar(1) DEFAULT NULL,
+        PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
+        CONSTRAINT `fn_qz_simprop_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`) REFERENCES `fn_qz_triggers` (`SCHED_NAME`, `TRIGGER_NAME`, `TRIGGER_GROUP`)
+        )
+*/
+
+@Table(name = "fn_qz_simprop_triggers")
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode
+@Getter
+@Setter
+@Entity
+@IdClass(FnQzTriggersId.class)
+public class FnQzSimpropTriggers {
+       @Id
+       @ManyToOne
+       @JoinColumns(value = {
+               @JoinColumn(name = "SCHED_NAME", referencedColumnName = "SCHED_NAME"),
+               @JoinColumn(name = "TRIGGER_NAME", referencedColumnName = "TRIGGER_NAME"),
+               @JoinColumn(name = "TRIGGER_GROUP", referencedColumnName = "TRIGGER_GROUP")
+       })
+       private FnQzTriggers fnQzTriggers;
+       @Id
+       @Valid
+       @Column(name = "SCHED_NAME", length = 120, insertable = false, updatable = false)
+       private String schedName;
+       @Id
+       @Column(name = "TRIGGER_NAME", length = 200, nullable = false, insertable = false, updatable = false)
+       @Size(max = 200)
+       @SafeHtml
+       private String triggerName;
+       @Id
+       @Column(name = "TRIGGER_GROUP", length = 200, nullable = false, insertable = false, updatable = false)
+       @Size(max = 200)
+       @SafeHtml
+       private String triggerGroup;
+       @Column(name = "STR_PROP_1", length = 512, columnDefinition = "varchar(512) DEFAULT NULL")
+       @Size(max = 512)
+       @SafeHtml
+       private String strProp1;
+       @Column(name = "STR_PROP_2", length = 512, columnDefinition = "varchar(512) DEFAULT NULL")
+       @Size(max = 512)
+       @SafeHtml
+       private String strProp2;
+       @Column(name = "STR_PROP_3", length = 512, columnDefinition = "varchar(512) DEFAULT NULL")
+       @Size(max = 512)
+       @SafeHtml
+       private String strProp3;
+       @Column(name = "INT_PROP_1", length = 11,columnDefinition = "int(11) DEFAULT NULL")
+       @Digits(integer = 11, fraction = 0)
+       private Integer intProp1;
+       @Column(name = "INT_PROP_2", length = 11, columnDefinition = "int(11) DEFAULT NULL")
+       @Digits(integer = 11, fraction = 0)
+       private Integer intProp2;
+       @Column(name = "LONG_PROP_1", length = 20, columnDefinition = "bigint(20) DEFAULT NULL")
+       @Digits(integer = 20, fraction = 0)
+       private Long LONG_PROP_1;
+       @Column(name = "LONG_PROP_2", length = 20, columnDefinition = "bigint(20) DEFAULT NULL")
+       @Digits(integer = 20, fraction = 0)
+       private Long LONG_PROP_2;
+       @Column(name = "DEC_PROP_1", columnDefinition = "decimal(13,4) DEFAULT NULL")
+       @Digits(integer = 13, fraction = 4)
+       private Double decProp1;
+       @Column(name = "DEC_PROP_2", columnDefinition = "decimal(13,4) DEFAULT NULL")
+       @Digits(integer = 13, fraction = 4)
+       private Double decProp2;
+       @Column(name = "BOOL_PROP_1", length = 1, columnDefinition = "varchar(1) DEFAULT NULL")
+       @Size(max = 1)
+       @SafeHtml
+       private String boolProp1;
+       @Column(name = "BOOL_PROP_2", length = 1, columnDefinition = "varchar(1) DEFAULT NULL")
+       @Size(max = 1)
+       @SafeHtml
+       private String boolProp2;
+}
\ No newline at end of file
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzTriggers.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzTriggers.java
new file mode 100644 (file)
index 0000000..526de11
--- /dev/null
@@ -0,0 +1,190 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import java.math.BigInteger;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.Index;
+import javax.persistence.JoinColumn;
+import javax.persistence.JoinColumns;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.validation.Valid;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.onap.portal.domain.db.fn.compositePK.FnQzTriggersId;
+
+/*
+CREATE TABLE `fn_qz_triggers` (
+        `SCHED_NAME` varchar(120) NOT NULL,
+        `TRIGGER_NAME` varchar(200) NOT NULL,
+        `TRIGGER_GROUP` varchar(200) NOT NULL,
+        `JOB_NAME` varchar(200) NOT NULL,
+        `JOB_GROUP` varchar(200) NOT NULL,
+        `DESCRIPTION` varchar(250) DEFAULT NULL,
+        `NEXT_FIRE_TIME` bigint(13) DEFAULT NULL,
+        `PREV_FIRE_TIME` bigint(13) DEFAULT NULL,
+        `PRIORITY` int(11) DEFAULT NULL,
+        `TRIGGER_STATE` varchar(16) NOT NULL,
+        `TRIGGER_TYPE` varchar(8) NOT NULL,
+        `START_TIME` bigint(13) NOT NULL,
+        `END_TIME` bigint(13) DEFAULT NULL,
+        `CALENDAR_NAME` varchar(200) DEFAULT NULL,
+        `MISFIRE_INSTR` smallint(2) DEFAULT NULL,
+        `JOB_DATA` blob DEFAULT NULL,
+        PRIMARY KEY (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`),
+        KEY `idx_fn_qz_t_j` (`SCHED_NAME`,`JOB_NAME`,`JOB_GROUP`),
+        KEY `idx_fn_qz_t_jg` (`SCHED_NAME`,`JOB_GROUP`),
+        KEY `idx_fn_qz_t_c` (`SCHED_NAME`,`CALENDAR_NAME`),
+        KEY `idx_fn_qz_t_g` (`SCHED_NAME`,`TRIGGER_GROUP`),
+        KEY `idx_fn_qz_t_state` (`SCHED_NAME`,`TRIGGER_STATE`),
+        KEY `idx_fn_qz_t_n_state` (`SCHED_NAME`,`TRIGGER_NAME`,`TRIGGER_GROUP`,`TRIGGER_STATE`),
+        KEY `idx_fn_qz_t_n_g_state` (`SCHED_NAME`,`TRIGGER_GROUP`,`TRIGGER_STATE`),
+        KEY `idx_fn_qz_t_next_fire_time` (`SCHED_NAME`,`NEXT_FIRE_TIME`),
+        KEY `idx_fn_qz_t_nft_st` (`SCHED_NAME`,`TRIGGER_STATE`,`NEXT_FIRE_TIME`),
+        KEY `idx_fn_qz_t_nft_misfire` (`SCHED_NAME`,`MISFIRE_INSTR`,`NEXT_FIRE_TIME`),
+        KEY `idx_fn_qz_t_nft_st_misfire` (`SCHED_NAME`,`MISFIRE_INSTR`,`NEXT_FIRE_TIME`,`TRIGGER_STATE`),
+        KEY `idx_fn_qz_t_nft_st_misfire_grp` (`SCHED_NAME`,`MISFIRE_INSTR`,`NEXT_FIRE_TIME`,`TRIGGER_GROUP`,`TRIGGER_STATE`),
+        CONSTRAINT `fn_qz_triggers_ibfk_1` FOREIGN KEY (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`) REFERENCES `fn_qz_job_details` (`SCHED_NAME`, `JOB_NAME`, `JOB_GROUP`)
+        )
+*/
+
+@Table(name = "fn_qz_triggers", indexes = {
+        @Index(name = "idx_fn_qz_t_j", columnList = "sched_name, job_name, job_group"),
+        @Index(name = "idx_fn_qz_t_jg", columnList = "sched_name, job_group"),
+        @Index(name = "idx_fn_qz_t_c", columnList = "sched_name, calendar_name"),
+        @Index(name = "idx_fn_qz_t_g", columnList = "sched_name, trigger_group"),
+        @Index(name = "idx_fn_qz_t_state", columnList = "sched_name, trigger_state"),
+        @Index(name = "idx_fn_qz_t_n_state", columnList = "sched_name, trigger_name, trigger_group, trigger_state"),
+        @Index(name = "idx_fn_qz_t_n_g_state", columnList = "sched_name, trigger_group, trigger_state"),
+        @Index(name = "idx_fn_qz_t_next_fire_time", columnList = "sched_name, next_fire_time"),
+        @Index(name = "idx_fn_qz_t_nft_st", columnList = "sched_name, trigger_state, next_fire_time"),
+        @Index(name = "idx_fn_qz_t_nft_misfire", columnList = "sched_name, misfire_instr, next_fire_time"),
+        @Index(name = "idx_fn_qz_t_nft_st_misfire", columnList = "sched_name, misfire_instr, next_fire_time, trigger_state"),
+        @Index(name = "idx_fn_qz_t_nft_st_misfire_grp", columnList = "sched_name, misfire_instr, next_fire_time, trigger_group, trigger_state")
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+@IdClass(FnQzTriggersId.class)
+public class FnQzTriggers {
+       @ManyToOne
+       @JoinColumns(value = {
+               @JoinColumn(name = "SCHED_NAME", referencedColumnName = "SCHED_NAME"),
+               @JoinColumn(name = "JOB_NAME", referencedColumnName = "JOB_NAME"),
+               @JoinColumn(name = "JOB_GROUP", referencedColumnName = "JOB_GROUP")
+       })
+       @NotNull
+       private FnQzJobDetails fnQzJobDetails;
+       @Id
+       @Valid
+       @Column(name = "SCHED_NAME", length = 120, insertable = false, updatable = false)
+       private String schedName;
+       @Id
+       @Valid
+       @Column(name = "TRIGGER_NAME", length = 200)
+       private String triggerName;
+       @Id
+       @Valid
+       @Column(name = "TRIGGER_GROUP", length = 200)
+       private String triggerGroup;
+       @Column(name = "JOB_NAME", length = 200, nullable = false, insertable = false, updatable = false)
+       @Size(max = 200)
+       @SafeHtml
+       @NotNull
+       private String jobName;
+       @Column(name = "JOB_GROUP", length = 200, nullable = false, insertable = false, updatable = false)
+       @Size(max = 200)
+       @SafeHtml
+       @NotNull
+       private String jobGroup;
+
+       @Column(name = "DESCRIPTION", length = 250, columnDefinition = "varchar(250) DEFAULT NULL")
+       @Size(max = 250)
+       @SafeHtml
+       private String description;
+       @Column(name = "NEXT_FIRE_TIME", length = 13, columnDefinition = "bigint(13) DEFAULT NULL")
+       @Digits(integer = 13, fraction = 0)
+       private Long nextFireTime;
+       @Column(name = "PREV_FIRE_TIME", length = 13, columnDefinition = "bigint(13) DEFAULT NULL")
+       @Digits(integer = 13, fraction = 0)
+       private Long prevFireTime;
+       @Column(name = "PRIORITY", length = 11, columnDefinition = "int(11) DEFAULT NULL")
+       @Digits(integer = 11, fraction = 0)
+       private Integer priority;
+       @Column(name = "TRIGGER_STATE", length = 16, nullable = false)
+       @Size(max = 16)
+       @SafeHtml
+       @NotNull
+       private String triggerState;
+       @Column(name = "TRIGGER_TYPE", length = 8, nullable = false)
+       @Size(max = 8)
+       @SafeHtml
+       @NotNull
+       private String triggerType;
+       @Column(name = "START_TIME", length = 13, nullable = false)
+       @Digits(integer = 13, fraction = 0)
+       @NotNull
+       private Long startTime;
+       @Column(name = "END_TIME", length = 13, columnDefinition = "bigint(13) DEFAULT NULL")
+       @Digits(integer = 13, fraction = 0)
+       private Long endTime;
+       @Column(name = "CALENDAR_NAME", length = 200, columnDefinition = "varchar(200) DEFAULT NULL")
+       @Size(max = 200)
+       @SafeHtml
+       private String calendarName;
+       @Column(name = "MISFIRE_INSTR", length = 2, columnDefinition = "smallint(2) DEFAULT NULL")
+       @Digits(integer = 2, fraction = 0)
+       private BigInteger misfireInstr;
+       @Column(name = "JOB_DATA", columnDefinition = "blob DEFAULT NULL")
+       private byte[] jobData;
+}
\ No newline at end of file
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnRestrictedUrl.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnRestrictedUrl.java
new file mode 100644 (file)
index 0000000..bbe6405
--- /dev/null
@@ -0,0 +1,109 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import java.io.Serializable;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.Index;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.onap.portal.domain.db.fn.FnRestrictedUrl.FnRestrictedUrlId;
+
+/*
+CREATE TABLE `fn_restricted_url` (
+        `restricted_url` varchar(250) NOT NULL,
+        `function_cd` varchar(30) NOT NULL,
+        PRIMARY KEY (`restricted_url`,`function_cd`),
+        KEY `fk_restricted_url_function_cd` (`function_cd`),
+        CONSTRAINT `fk_restricted_url_function_cd` FOREIGN KEY (`function_cd`) REFERENCES `fn_function` (`function_cd`)
+        )
+*/
+
+@Table(name = "fn_restricted_url", indexes = {
+        @Index(name = "fk_restricted_url_function_cd", columnList = "function_cd")
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode
+@Getter
+@Setter
+@Entity
+@IdClass(FnRestrictedUrlId.class)
+public class FnRestrictedUrl {
+       @Column(name = "restricted_url", length = 250, nullable = false)
+       @Size(max = 250)
+       @SafeHtml
+       @Id
+       private String restricted_url;
+       @ManyToOne()
+       @JoinColumn(name = "function_cd", nullable = false)
+       @Valid
+       @NotNull
+       @Id
+       private FnFunction functionCd;
+
+       @Getter
+       @Setter
+       @NoArgsConstructor
+       @EqualsAndHashCode
+       @AllArgsConstructor
+       public static class FnRestrictedUrlId implements Serializable {
+              @Size(max = 250)
+              @SafeHtml
+              private String restricted_url;
+              @Valid
+              @NotNull
+              private FnFunction functionCd;
+       }
+}
\ No newline at end of file
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnRole.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnRole.java
new file mode 100644 (file)
index 0000000..dc45788
--- /dev/null
@@ -0,0 +1,222 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Index;
+import javax.persistence.JoinColumn;
+import javax.persistence.JoinTable;
+import javax.persistence.ManyToMany;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+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;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+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;
+
+/*
+CREATE TABLE `fn_role` (
+        `role_id` int(11) NOT NULL AUTO_INCREMENT,
+        `role_name` varchar(300) NOT NULL,
+        `active_yn` varchar(1) NOT NULL DEFAULT 'y',
+        `priority` decimal(4,0) DEFAULT NULL,
+        `app_id` int(11) DEFAULT NULL,
+        `app_role_id` int(11) DEFAULT NULL,
+        PRIMARY KEY (`role_id`),
+        UNIQUE KEY `fn_role_name_app_id_idx` (`role_name`,`app_id`) USING BTREE
+        )
+*/
+
+@NamedQueries({
+        @NamedQuery(
+                name = "FnRole.retrieveAppRolesByRoleNameAndByAppId",
+                query = "FROM FnRole where role_name =:roleName and app_id =:appId"),
+        @NamedQuery(
+                name = "FnRole.retrieveAppRolesByAppId",
+                query = "FROM FnRole where app_id =:appId"),
+        @NamedQuery(
+                name = "FnRole.retrieveAppRolesWhereAppIdIsNull",
+                query = "FROM FnRole where app_id is null"),
+        @NamedQuery(
+                name = "FnRole.retrieveAppRoleByRoleIdWhereAppIdIsNull",
+                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"),
+        @NamedQuery(
+                name = "FnRole.retrieveAppRoleByRoleIdAndAppId",
+                query = "FROM FnRole where role_id =:roleId and app_id =:appId"),
+        @NamedQuery(
+                name = "FnRole.retrieveAppRolesByRoleNameAndWhereAppIdIsNull",
+                query = "FROM FnRole where role_name =:roleName and app_id is null"),
+        @NamedQuery(
+                name = "FnRole.retrieveActiveRolesOfApplication",
+                query = "from FnRole where active_yn = 'Y' and app_id=:appId"),
+        @NamedQuery(name = "FnRole.retrieveRoleToUpdateInExternalAuthSystem",
+                query = "FROM FnRole where role_name =:roleName and app_id =:appId")
+})
+
+@Table(name = "fn_role", indexes = {
+        @Index(name = "fn_role_name_app_id_idx", columnList = "role_name, app_id", unique = true)
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class FnRole {
+
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "role_id", length = 11, nullable = false)
+       @Digits(integer = 11, fraction = 0)
+       private Long roleId;
+       @Column(name = "role_name", length = 300, nullable = false)
+       @Size(max = 300)
+       @NotNull
+       @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;
+       @Column(name = "priority", length = 4, columnDefinition = "decimal(4,0) DEFAULT NULL")
+       @Digits(integer = 4, fraction = 0)
+       private Long priority;
+       @Column(name = "app_Id", length = 11, columnDefinition = "int(11) default null")
+       @Digits(integer = 11, fraction = 0)
+       private Long appId;
+       @Column(name = "app_role_id", length = 11, columnDefinition = "int(11) default null")
+       @Digits(integer = 11, fraction = 0)
+       private Long appRoleId;
+       @OneToMany(
+               targetEntity = FnRoleFunction.class,
+               mappedBy = "roleId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<FnRoleFunction> fnRoleFunctions = new ArrayList<>();
+       @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+       @JoinTable(
+               name = "fn_user_pseudo_role",
+               joinColumns = {@JoinColumn(name = "pseudo_role_Id", referencedColumnName = "role_id")},
+               inverseJoinColumns = {@JoinColumn(name = "user_id", referencedColumnName = "user_id")},
+               indexes = {
+                       @Index(name = "fk_pseudo_role_user_id", columnList = "user_id")
+               }
+       )
+       private List<FnUser> fnUsers = new ArrayList<>();
+       @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+       @JoinTable(
+               name = "fn_role_composite",
+               joinColumns = {@JoinColumn(name = "parent_role_id", referencedColumnName = "role_id")},
+               inverseJoinColumns = {@JoinColumn(name = "child_role_id", referencedColumnName = "role_id")},
+               indexes = {
+                       @Index(name = "fk_fn_role_composite_child", columnList = "child_role_id")
+               }
+       )
+       private List<FnRole> fnRoles = new ArrayList<>();
+       @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+       private List<FnRole> fnRoleList = new ArrayList<>();
+       @OneToMany(
+               targetEntity = EpRoleNotification.class,
+               mappedBy = "notificationID",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<EpRoleNotification> epRoleNotifications = new ArrayList<>();
+       @OneToMany(
+               targetEntity = FnMenuFunctionalRoles.class,
+               mappedBy = "roleId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<FnMenuFunctionalRoles> fnMenuFunctionalRoles = new ArrayList<>();
+       @OneToMany(
+               targetEntity = EpWidgetCatalogRole.class,
+               mappedBy = "roleId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<EpWidgetCatalogRole> epWidgetCatalogRoles = new ArrayList<>();
+       @OneToMany(
+               targetEntity = EpAppRoleFunction.class,
+               mappedBy = "fnRole",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<EpAppRoleFunction> epAppRoleFunctions = new ArrayList<>();
+       @OneToMany(
+               targetEntity = EpUserRolesRequestDet.class,
+               mappedBy = "requestedRoleId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<EpUserRolesRequestDet> epUserRolesRequestDets = new ArrayList<>();
+       @OneToMany(
+               targetEntity = FnUserRole.class,
+               mappedBy = "roleId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<FnUserRole> fnUserRoles = new ArrayList<>();
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnRoleFunction.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnRoleFunction.java
new file mode 100644 (file)
index 0000000..b62e8c2
--- /dev/null
@@ -0,0 +1,110 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import java.io.Serializable;
+import javax.persistence.CascadeType;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.Index;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import lombok.AllArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.onap.portal.domain.db.fn.FnRoleFunction.FnRoleFunctionId;
+
+/*
+CREATE TABLE `fn_role_function` (
+        `role_id` int(11) NOT NULL,
+        `function_cd` varchar(30) NOT NULL,
+        PRIMARY KEY (`role_id`,`function_cd`),
+        KEY `fn_role_function_function_cd` (`function_cd`) USING BTREE,
+        KEY `fn_role_function_role_id` (`role_id`) USING BTREE,
+        CONSTRAINT `fk_fn_role__ref_198_fn_role` FOREIGN KEY (`role_id`) REFERENCES `fn_role` (`role_id`),
+        CONSTRAINT `fk_fn_role__ref_201_fn_funct` FOREIGN KEY (`function_cd`) REFERENCES `fn_function` (`function_cd`)
+        )
+*/
+
+@Table(name = "fn_role_function", indexes = {
+        @Index(name = "fn_role_function_function_cd", columnList = "function_cd"),
+        @Index(name = "fn_role_function_role_id", columnList = "role_id")
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+@IdClass(FnRoleFunctionId.class)
+public class FnRoleFunction {
+
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "role_Id", nullable = false)
+       @Valid
+       @NotNull
+       @Id
+       private FnRole roleId;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "function_cd", nullable = false)
+       @Valid
+       @NotNull
+       @Id
+       private FnFunction functionCd;
+
+       @Getter
+       @Setter
+       @NoArgsConstructor
+       @EqualsAndHashCode
+       @AllArgsConstructor
+       public static class FnRoleFunctionId implements Serializable {
+              @Valid
+              private FnRole roleId;
+              @Valid
+              private FnFunction functionCd;
+       }
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnRoleV.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnRoleV.java
new file mode 100644 (file)
index 0000000..7eb96d6
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import java.math.BigInteger;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import org.hibernate.annotations.Immutable;
+import org.hibernate.annotations.Subselect;
+
+@Entity
+@Table(name = "fn_role_v")
+@Immutable
+@Subselect("select fn_role.role_id as role_id,"
+        + "         fn_role.role_name as role_name,"
+        + "         fn_role.active_yn as active_yn,"
+        + "         fn_role.priority as priority,"
+        + "         fn_role.app_id as app_id,"
+        + "         fn_role.app_role_id as app_role_id"
+        + " from fn_role where isnull(fn_role.app_id)")
+@Getter
+@NoArgsConstructor
+public class FnRoleV {
+       @Id
+       @Column(name = "role_id")
+       private Integer roleId;
+       @Column(name = "role_name")
+       private String roleName;
+       @Column(name = "active_yn")
+       private String activeYn;
+       @Column(name = "priority")
+       private BigInteger priority;
+       @Column(name = "app_Id")
+       private Integer appId;
+       @Column(name = "app_role_id")
+       private Integer appRoleId;
+}
+
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnScheduleWorkflows.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnScheduleWorkflows.java
new file mode 100644 (file)
index 0000000..e361b11
--- /dev/null
@@ -0,0 +1,117 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import java.math.BigInteger;
+import java.time.LocalDateTime;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+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.NotNull;
+import javax.validation.constraints.PastOrPresent;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.hibernate.validator.constraints.URL;
+
+/*
+CREATE TABLE `fn_schedule_workflows` (
+        `id_schedule_workflows` bigint(25) NOT NULL AUTO_INCREMENT,
+        `workflow_server_url` varchar(45) DEFAULT NULL,
+        `workflow_key` varchar(45) NOT NULL,
+        `workflow_arguments` varchar(45) DEFAULT NULL,
+        `startDateTimeCron` varchar(45) DEFAULT NULL,
+        `endDateTime` timestamp NOT NULL DEFAULT current_timestamp(),
+        `start_date_time` timestamp NOT NULL DEFAULT current_timestamp(),
+        `recurrence` varchar(45) DEFAULT NULL,
+        PRIMARY KEY (`id_schedule_workflows`)
+        )
+*/
+
+@Table(name = "fn_schedule_workflows")
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class FnScheduleWorkflows {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "id_schedule_workflows", nullable = false, length = 25, columnDefinition = "bigint(25) AUTO_INCREMENT")
+       @Digits(integer = 25, fraction = 0)
+       private BigInteger idScheduleWorkflows;
+       @Column(name = "workflow_server_url", length = 45, columnDefinition = "varchar(45) default null")
+       @Size(max = 45)
+       @SafeHtml
+       //TODO URL
+       @URL
+       private String workflowServerUrl;
+       @Column(name = "workflow_key", length = 45, nullable = false)
+       @Size(max = 45)
+       @SafeHtml
+       @NotNull
+       private String workflowKey;
+       @Column(name = "workflow_arguments", length = 45, columnDefinition = "varchar(45) default null")
+       @Size(max = 45)
+       @SafeHtml
+       private String workflowArguments;
+       @Column(name = "startDateTimeCron", length = 45, columnDefinition = "varchar(45) default null")
+       @Size(max = 45)
+       @SafeHtml
+       private String startDateTimeCron;
+       @Column(name = "endDateTime", columnDefinition = "DATETIME default NOW()")
+       @PastOrPresent
+       private LocalDateTime endDateTime;
+       @Column(name = "start_date_time", columnDefinition = "DATETIME default NOW()")
+       @PastOrPresent
+       private LocalDateTime startDateTime;
+       @Column(name = "recurrence", length = 45, columnDefinition = "varchar(45) default null")
+       @Size(max = 45)
+       @SafeHtml
+       private String recurrence;
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnSharedContext.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnSharedContext.java
new file mode 100644 (file)
index 0000000..4804570
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import java.time.LocalDateTime;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.persistence.UniqueConstraint;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.PastOrPresent;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+CREATE TABLE `fn_shared_context` (
+        `id` int(11) NOT NULL AUTO_INCREMENT,
+        `create_time` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
+        `context_id` varchar(64) NOT NULL,
+        `ckey` varchar(128) NOT NULL,
+        `cvalue` varchar(1024) DEFAULT NULL,
+        PRIMARY KEY (`id`),
+        UNIQUE KEY `session_key` (`context_id`,`ckey`)
+        )
+*/
+
+@Table(name = "fn_shared_context", uniqueConstraints ={
+        @UniqueConstraint(columnNames = {"context_Id", "ckey"})
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class FnSharedContext {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "id", nullable = false, length = 11, columnDefinition = "int(11) AUTO_INCREMENT")
+       @Digits(integer = 11, fraction = 0)
+       private Long id;
+       @Column(name = "create_time", nullable = false, columnDefinition = "timestamp DEFAULT current_timestamp() ON UPDATE current_timestamp()")
+       @PastOrPresent
+       @NotNull
+       private LocalDateTime createTime;
+       @Column(name = "context_id", length = 64, nullable = false)
+       @Size(max = 64)
+       @SafeHtml
+       @NotNull
+       private String contextId;
+       @Column(name = "ckey", length = 128, nullable = false)
+       @Size(max = 128)
+       @SafeHtml
+       @NotNull
+       private String ckey;
+       @Column(name = "cvalue", length = 1024, nullable = false)
+       @Size(max = 1024)
+       @SafeHtml
+       @NotNull
+       private String cvalue;
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnTab.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnTab.java
new file mode 100644 (file)
index 0000000..020b310
--- /dev/null
@@ -0,0 +1,147 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.List;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.Id;
+import javax.persistence.Index;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.validation.Valid;
+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;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+/*
+CREATE TABLE `fn_tab` (
+        `tab_cd` varchar(30) NOT NULL,
+        `tab_name` varchar(50) NOT NULL,
+        `tab_descr` varchar(100) DEFAULT NULL,
+        `action` varchar(100) NOT NULL,
+        `function_cd` varchar(30) NOT NULL,
+        `active_yn` char(1) NOT NULL,
+        `sort_order` decimal(11,0) NOT NULL,
+        `parent_tab_cd` varchar(30) DEFAULT NULL,
+        `tab_set_cd` varchar(30) DEFAULT NULL,
+        PRIMARY KEY (`tab_cd`),
+        KEY `fk_fn_tab_function_cd` (`function_cd`),
+        KEY `fk_fn_tab_set_cd` (`tab_set_cd`),
+        CONSTRAINT `fk_fn_tab_function_cd` FOREIGN KEY (`function_cd`) REFERENCES `fn_function` (`function_cd`),
+        CONSTRAINT `fk_fn_tab_set_cd` FOREIGN KEY (`tab_set_cd`) REFERENCES `fn_lu_tab_set` (`tab_set_cd`)
+        )
+*/
+
+@Table(name = "fn_tab", indexes = {
+        @Index(name = "fk_fn_tab_function_cd", columnList = "function_cd"),
+        @Index(name = "fk_fn_tab_set_cd", columnList = "tab_set_cd")
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class FnTab {
+       @Id
+       @Column(name = "tab_cd", length = 30, nullable = false)
+       @Size(max = 30)
+       @SafeHtml
+       private String tabCd;
+       @Column(name = "tab_name", length = 50, nullable = false)
+       @Size(max = 50)
+       @SafeHtml
+       @NotNull
+       private String tabName;
+       @Column(name = "tab_descr", length = 100, columnDefinition = "varchar(100) DEFAULT NULL")
+       @Size(max = 100)
+       @SafeHtml
+       private String tabDescr;
+       @Column(name = "action", length = 100, nullable = false)
+       @Size(max = 100)
+       @SafeHtml
+       @NotNull
+       private String action;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "function_cd", nullable = false)
+       @NotNull
+       @Valid
+       private FnFunction functionCd;
+       @Column(name = "active_yn", length = 1, nullable = false)
+       @Pattern(regexp = "[YNyn]")
+       @Size(max = 1)
+       @NotNull
+       @SafeHtml
+       private String activeYn;
+       @Column(name = "sort_order", length = 11, nullable = false)
+       @Digits(integer = 11, fraction = 0)
+       @NotNull
+       private BigInteger sortDrder;
+       @Column(name = "parent_tab_cd", length = 30, columnDefinition = "varchar(30) DEFAULT NULL")
+       @Size(max = 30)
+       @SafeHtml
+       private String parentTabCd;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "tab_set_cd", nullable = false)
+       @NotNull
+       @Valid
+       private FnLuTabSet fnLuTabSet;
+       @OneToMany(
+               targetEntity = FnTabSelected.class,
+               mappedBy = "selectedTabCd",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<FnTabSelected> selectedTabCd = new ArrayList<>();
+
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnTabSelected.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnTabSelected.java
new file mode 100644 (file)
index 0000000..8f4c10b
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import java.io.Serializable;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.Id;
+import javax.persistence.IdClass;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.validation.Valid;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.onap.portal.domain.db.fn.FnTabSelected.FnTabSelectedId;
+
+/*
+CREATE TABLE `fn_tab_selected` (
+        `selected_tab_cd` varchar(30) NOT NULL,
+        `tab_uri` varchar(40) NOT NULL,
+        PRIMARY KEY (`selected_tab_cd`,`tab_uri`),
+        CONSTRAINT `fk_fn_tab_selected_tab_cd` FOREIGN KEY (`selected_tab_cd`) REFERENCES `fn_tab` (`tab_cd`)
+        )
+*/
+
+@Table(name = "fn_tab_selected")
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode
+@Getter
+@Setter
+@Entity
+@IdClass(FnTabSelectedId.class)
+public class FnTabSelected {
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "selected_tab_cd", nullable = false)
+       @NotNull
+       @Valid
+       @Id
+       private FnTab selectedTabCd;
+       @Column(name = "tab_uri", length = 40, nullable = false)
+       @Size(max = 40)
+       @SafeHtml
+       @Id
+       private String tab_uri;
+
+       @Getter
+       @Setter
+       @NoArgsConstructor
+       @EqualsAndHashCode
+       @AllArgsConstructor
+       public static class FnTabSelectedId implements Serializable {
+              @Valid
+              private FnTab selectedTabCd;
+              @Size(max = 40)
+              @SafeHtml
+              private String tab_uri;
+       }
+}
\ No newline at end of file
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnUser.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnUser.java
new file mode 100644 (file)
index 0000000..8a778bf
--- /dev/null
@@ -0,0 +1,477 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import java.time.LocalDateTime;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.stream.Collectors;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Index;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToMany;
+import javax.persistence.ManyToOne;
+import javax.persistence.NamedNativeQueries;
+import javax.persistence.NamedNativeQuery;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.persistence.UniqueConstraint;
+import javax.validation.Valid;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.Email;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.PastOrPresent;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+import org.onap.portal.domain.db.cr.CrReportFileHistory;
+import org.onap.portal.domain.db.ep.EpPersUserWidgetPlacement;
+import org.onap.portal.domain.db.ep.EpPersUserWidgetSel;
+import org.onap.portal.domain.db.ep.EpUserNotification;
+import org.onap.portal.domain.db.ep.EpUserRolesRequest;
+import org.onap.portal.domain.db.ep.EpWidgetCatalogParameter;
+import org.onap.portal.domain.dto.DomainVo;
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.security.core.authority.SimpleGrantedAuthority;
+import org.springframework.security.core.userdetails.UserDetails;
+
+/*
+CREATE TABLE `fn_user` (
+        `user_id` int(11) NOT NULL AUTO_INCREMENT,
+        `org_id` int(11) DEFAULT NULL,
+        `manager_id` int(11) DEFAULT NULL,
+        `first_name` varchar(50) DEFAULT NULL,
+        `middle_name` varchar(50) DEFAULT NULL,
+        `last_name` varchar(50) DEFAULT NULL,
+        `phone` varchar(25) DEFAULT NULL,
+        `fax` varchar(25) DEFAULT NULL,
+        `cellular` varchar(25) DEFAULT NULL,
+        `email` varchar(50) DEFAULT NULL,
+        `address_id` decimal(11,0) DEFAULT NULL,
+        `alert_method_cd` varchar(10) DEFAULT NULL,
+        `hrid` varchar(20) DEFAULT NULL,
+        `org_user_id` varchar(20) DEFAULT NULL,
+        `org_code` varchar(30) DEFAULT NULL,
+        `login_id` varchar(25) DEFAULT NULL,
+        `login_pwd` varchar(100) DEFAULT NULL,
+        `last_login_date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
+        `active_yn` varchar(1) NOT NULL DEFAULT 'y',
+        `created_id` int(11) DEFAULT NULL,
+        `created_date` timestamp NOT NULL DEFAULT current_timestamp(),
+        `modified_id` int(11) DEFAULT NULL,
+        `modified_date` timestamp NOT NULL DEFAULT current_timestamp(),
+        `is_internal_yn` char(1) NOT NULL DEFAULT 'n',
+        `address_line_1` varchar(100) DEFAULT NULL,
+        `address_line_2` varchar(100) DEFAULT NULL,
+        `city` varchar(50) DEFAULT NULL,
+        `state_cd` varchar(3) DEFAULT NULL,
+        `zip_code` varchar(11) DEFAULT NULL,
+        `country_cd` varchar(3) DEFAULT NULL,
+        `location_clli` varchar(8) DEFAULT NULL,
+        `org_manager_userid` varchar(20) DEFAULT NULL,
+        `company` varchar(100) DEFAULT NULL,
+        `department_name` varchar(100) DEFAULT NULL,
+        `job_title` varchar(100) DEFAULT NULL,
+        `timezone` int(11) DEFAULT NULL,
+        `department` varchar(25) DEFAULT NULL,
+        `business_unit` varchar(25) DEFAULT NULL,
+        `business_unit_name` varchar(100) DEFAULT NULL,
+        `cost_center` varchar(25) DEFAULT NULL,
+        `fin_loc_code` varchar(10) DEFAULT NULL,
+        `silo_status` varchar(10) DEFAULT NULL,
+        `language_id` int(2) NOT NULL DEFAULT 1,
+        PRIMARY KEY (`user_id`),
+        UNIQUE KEY `fn_user_hrid` (`hrid`) USING BTREE,
+        UNIQUE KEY `fn_user_login_id` (`login_id`) USING BTREE,
+        KEY `fn_user_address_id` (`address_id`) USING BTREE,
+        KEY `fn_user_alert_method_cd` (`alert_method_cd`) USING BTREE,
+        KEY `fn_user_org_id` (`org_id`) USING BTREE,
+        KEY `fk_fn_user_ref_197_fn_user` (`manager_id`),
+        KEY `fk_fn_user_ref_198_fn_user` (`created_id`),
+        KEY `fk_fn_user_ref_199_fn_user` (`modified_id`),
+        KEY `fk_timezone` (`timezone`),
+        CONSTRAINT `fk_fn_user_ref_110_fn_org` FOREIGN KEY (`org_id`) REFERENCES `fn_org` (`org_id`),
+        CONSTRAINT `fk_fn_user_ref_123_fn_lu_al` FOREIGN KEY (`alert_method_cd`) REFERENCES `fn_lu_alert_method` (`alert_method_cd`),
+        CONSTRAINT `fk_fn_user_ref_197_fn_user` FOREIGN KEY (`manager_id`) REFERENCES `fn_user` (`user_id`),
+        CONSTRAINT `fk_fn_user_ref_198_fn_user` FOREIGN KEY (`created_id`) REFERENCES `fn_user` (`user_id`),
+        CONSTRAINT `fk_fn_user_ref_199_fn_user` FOREIGN KEY (`modified_id`) REFERENCES `fn_user` (`user_id`),
+        CONSTRAINT `fk_timezone` FOREIGN KEY (`timezone`) REFERENCES `fn_lu_timezone` (`timezone_id`)
+        )
+*/
+
+@NamedNativeQueries({
+        @NamedNativeQuery(
+                name = "getUsersByOrgUserId",
+                query = "SELECT * FROM FnUser WHERE where org_user_id in :orgIds"
+        )
+})
+
+@Table(name = "fn_user", indexes = {
+        @Index(name = "fn_user_address_id", columnList = "address_id"),
+        @Index(name = "fn_user_alert_method_cd", columnList = "alert_method_cd"),
+        @Index(name = "fn_user_org_id", columnList = "org_id"),
+        @Index(name = "fk_fn_user_ref_197_fn_user", columnList = "manager_id"),
+        @Index(name = "fk_fn_user_ref_198_fn_user", columnList = "created_id"),
+        @Index(name = "fk_fn_user_ref_199_fn_user", columnList = "modified_id"),
+        @Index(name = "fk_timezone", columnList = "timezone")
+},
+        uniqueConstraints = {
+                @UniqueConstraint(name = "fn_user_hrid", columnNames = "hrid"),
+                @UniqueConstraint(name = "fn_user_login_id", columnNames = "login_id")
+        })
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class FnUser extends DomainVo implements UserDetails {
+
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "user_id", length = 11, nullable = false)
+       @Digits(integer = 11, fraction = 0)
+       private Long userId;
+       @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
+       @JoinColumn(name = "org_id", columnDefinition = "int(11) DEFAULT NULL")
+       @Valid
+       private FnOrg orgId;
+       @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+       @JoinColumn(name = "manager_id")
+       @Valid
+       private FnUser managerId;
+       @Column(name = "first_name", length = 50, columnDefinition = "varchar(50) DEFAULT NULL")
+       @Size(max = 50)
+       @SafeHtml
+       private String firstName;
+       @Column(name = "middle_name", length = 50, columnDefinition = "varchar(50) DEFAULT NULL")
+       @Size(max = 50)
+       @SafeHtml
+       private String middleName;
+       @Column(name = "last_name", length = 50, columnDefinition = "varchar(50) DEFAULT NULL")
+       @Size(max = 50)
+       @SafeHtml
+       private String lastName;
+       @Column(name = "phone", length = 25, columnDefinition = "varchar(25) DEFAULT NULL")
+       @Size(max = 25)
+       @SafeHtml
+       private String phone;
+       @Column(name = "fax", length = 25, columnDefinition = "varchar(25) DEFAULT NULL")
+       @Size(max = 25)
+       @SafeHtml
+       private String fax;
+       @Column(name = "cellular", length = 25, columnDefinition = "varchar(25) DEFAULT NULL")
+       @Size(max = 25)
+       @SafeHtml
+       private String cellular;
+       @Column(name = "email", length = 50, columnDefinition = "varchar(50) DEFAULT NULL")
+       @Size(max = 50)
+       @Email
+       @SafeHtml
+       private String email;
+       @Column(name = "address_id", columnDefinition = "decimal(11,0) DEFAULT NULL")
+       @Digits(integer = 11, fraction = 0)
+       private Long addressId;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "alert_method_cd", columnDefinition = "varchar(10) DEFAULT NULL")
+       private FnLuAlertMethod alertMethodCd;
+       @Column(name = "hrid", length = 20, columnDefinition = "varchar(20) DEFAULT NULL")
+       @Size(max = 20)
+       @SafeHtml
+       private String hrid;
+       @Column(name = "org_user_id", length = 20, columnDefinition = "varchar(20) DEFAULT NULL")
+       @Size(max = 20)
+       @SafeHtml
+       private String orgUserId;
+       @Column(name = "org_code", length = 30, columnDefinition = "varchar(30) DEFAULT NULL")
+       @Size(max = 30)
+       @SafeHtml
+       private String org_code;
+       @Column(name = "login_id", length = 25, columnDefinition = "varchar(25) DEFAULT NULL")
+       @Size(max = 25)
+       @SafeHtml
+       private String loginId;
+       @Column(name = "login_pwd", length = 100, columnDefinition = "varchar(100) DEFAULT NULL")
+       @Size(max = 100)
+       @SafeHtml
+       private String loginPwd;
+       @Column(name = "last_login_date", nullable = false, columnDefinition = "datetime DEFAULT current_timestamp() ON UPDATE current_timestamp()")
+       @PastOrPresent
+       protected LocalDateTime lastLoginDate;
+       @Column(name = "active_yn", length = 1, columnDefinition = "character varying(1) default 'y'", nullable = false)
+       @Size(max = 1)
+       @SafeHtml
+       @NotNull
+       private String activeYn;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "created_id")
+       @Valid
+       private FnUser createdId;
+       @Column(name = "created_date", columnDefinition = "datetime DEFAULT current_timestamp()", nullable = false)
+       @PastOrPresent
+       protected LocalDateTime createdDate;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "modified_id")
+       @Valid
+       private FnUser modifiedId;
+       @Column(name = "modified_date", nullable = false, columnDefinition = "datetime default now()")
+       @PastOrPresent
+       protected LocalDateTime modifiedDate;
+       @Column(name = "is_internal_yn", length = 1, columnDefinition = "character varying(1) default 'n'", nullable = false)
+       @Size(max = 1)
+       @SafeHtml
+       @NotNull
+       private String isInternalYn;
+       @Column(name = "address_line_1", length = 100, columnDefinition = "varchar(100) DEFAULT NULL")
+       @Size(max = 100)
+       @SafeHtml
+       private String addressLine1;
+       @Column(name = "address_line_2", length = 100, columnDefinition = "varchar(100) DEFAULT NULL")
+       @Size(max = 100)
+       @SafeHtml
+       private String addressLine2;
+       @Column(name = "city", length = 50, columnDefinition = "varchar(50) DEFAULT NULL")
+       @Size(max = 50)
+       @SafeHtml
+       private String city;
+       @Column(name = "state_cd", length = 3, columnDefinition = "varchar(3) DEFAULT NULL")
+       @Size(max = 3)
+       @SafeHtml
+       private String stateCd;
+       @Column(name = "zip_code", length = 11, columnDefinition = "varchar(11) DEFAULT NULL")
+       @Size(max = 11)
+       @SafeHtml
+       private String zipCode;
+       @Column(name = "country_cd", length = 3, columnDefinition = "varchar(3) DEFAULT NULL")
+       @Size(max = 3)
+       @SafeHtml
+       private String countryCd;
+       @Column(name = "location_clli", length = 8, columnDefinition = "varchar(8) DEFAULT NULL")
+       @Size(max = 8)
+       @SafeHtml
+       private String locationClli;
+       @Column(name = "org_manager_userid", length = 20, columnDefinition = "varchar(20) DEFAULT NULL")
+       @Size(max = 20)
+       @SafeHtml
+       private String orgManagerUserId;
+       @Column(name = "company", length = 100, columnDefinition = "varchar(100) DEFAULT NULL")
+       @Size(max = 100)
+       @SafeHtml
+       private String company;
+       @Column(name = "department_name", length = 200, columnDefinition = "varchar(100) DEFAULT NULL")
+       @Size(max = 200)
+       @SafeHtml
+       private String departmentName;
+       @Column(name = "job_title", length = 100, columnDefinition = "varchar(100) DEFAULT NULL")
+       @Size(max = 100)
+       @SafeHtml
+       private String jobTitle;
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
+       @JoinColumn(name = "timezone", columnDefinition = "int(11) DEFAULT NULL")
+       @Valid
+       private FnLuTimezone timezone;
+       @Column(name = "department", length = 25, columnDefinition = "varchar(25) DEFAULT NULL")
+       @Size(max = 25)
+       @SafeHtml
+       private String department;
+       @Column(name = "business_unit", length = 25, columnDefinition = "varchar(25) DEFAULT NULL")
+       @Size(max = 25)
+       @SafeHtml
+       private String businessUnit;
+       @Column(name = "business_unit_name", length = 100, columnDefinition = "varchar(100) DEFAULT NULL")
+       @Size(max = 100)
+       @SafeHtml
+       private String businessUnitName;
+       @Column(name = "cost_center", length = 25, columnDefinition = "varchar(25) DEFAULT NULL")
+       @Size(max = 25)
+       @SafeHtml
+       private String cost_center;
+       @Column(name = "fin_loc_code", length = 10, columnDefinition = "varchar(10) DEFAULT NULL")
+       @Size(max = 10)
+       @SafeHtml
+       private String finLocCode;
+       @Column(name = "silo_status", length = 10, columnDefinition = "varchar(10) DEFAULT NULL")
+       @Size(max = 10)
+       @SafeHtml
+       private String siloStatus;
+       @Column(name = "language_id", length = 2, columnDefinition = "int(2) default 1", nullable = false)
+       @Digits(integer = 2, fraction = 0)
+       @NotNull
+       private Long language_id;
+       @Column(name = "is_guest", columnDefinition = "boolean default 0", nullable = false)
+       @NotNull
+       private boolean guest;
+       @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "fnUserList")
+       private List<CrReportFileHistory> crReportFileHistorie = new ArrayList<>();
+       @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
+       private List<FnRole> fnRoles = new ArrayList<>();
+       @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+       private List<FnMenuFunctional> fnRoleList = new ArrayList<>();
+       @OneToMany(
+               targetEntity = FnAuditLog.class,
+               mappedBy = "userId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<FnAuditLog> fnAuditLogs = new ArrayList<>();
+       @OneToMany(
+               targetEntity = FnUser.class,
+               mappedBy = "createdId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<FnUser> fnUsersCreatedId = new ArrayList<>();
+       @OneToMany(
+               targetEntity = FnUser.class,
+               mappedBy = "managerId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<FnUser> fnUsersManagerId = new ArrayList<>();
+       @OneToMany(
+               targetEntity = FnUser.class,
+               mappedBy = "modifiedId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<FnUser> fnUsersModifiedId = new ArrayList<>();
+       @OneToMany(
+               targetEntity = EpUserRolesRequest.class,
+               mappedBy = "userId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<EpUserRolesRequest> epUserRolesRequests = new ArrayList<>();
+       @OneToMany(
+               targetEntity = FnPersUserAppSel.class,
+               mappedBy = "userId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<FnPersUserAppSel> persUserAppSels = new ArrayList<>();
+       @OneToMany(
+               targetEntity = EpWidgetCatalogParameter.class,
+               mappedBy = "userId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<EpWidgetCatalogParameter> epWidgetCatalogParameters = new ArrayList<>();
+       @OneToMany(
+               targetEntity = EpPersUserWidgetPlacement.class,
+               mappedBy = "userId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<EpPersUserWidgetPlacement> epPersUserWidgetPlacements = new ArrayList<>();
+       @OneToMany(
+               targetEntity = EpPersUserWidgetSel.class,
+               mappedBy = "userId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<EpPersUserWidgetSel> epPersUserWidgetSels = new ArrayList<>();
+       @OneToMany(
+               targetEntity = FnUserRole.class,
+               mappedBy = "userId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<FnUserRole> fnUserRoles = new ArrayList<>();
+       @OneToMany(
+               targetEntity = EpUserNotification.class,
+               mappedBy = "userId",
+               cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY
+       )
+       private List<EpUserNotification> epUserNotifications = new ArrayList<>();
+
+       @Override
+       public Collection<? extends GrantedAuthority> getAuthorities() {
+              return fnRoles
+                      .stream()
+                      .map(fnRole -> new SimpleGrantedAuthority("ROLE_" + fnRole.getRoleName()))
+                      .collect(Collectors.toList());
+       }
+
+       @Override
+       public String getPassword() {
+              return this.getLoginPwd();
+       }
+
+       @Override
+       public String getUsername() {
+              return this.getLoginId();
+       }
+
+       @Override
+       public boolean isAccountNonExpired() {
+              return true;
+       }
+
+       @Override
+       public boolean isAccountNonLocked() {
+              return true;
+       }
+
+       @Override
+       public boolean isCredentialsNonExpired() {
+              return true;
+       }
+
+       @Override
+       public boolean isEnabled() {
+              return true;
+       }
+
+       public String getFullName() {
+              return this.firstName + " " + this.lastName;
+       }
+
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnUserRole.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnUserRole.java
new file mode 100644 (file)
index 0000000..2eecd74
--- /dev/null
@@ -0,0 +1,131 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Index;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.NamedNativeQueries;
+import javax.persistence.NamedNativeQuery;
+import javax.persistence.OneToOne;
+import javax.persistence.Table;
+import javax.persistence.UniqueConstraint;
+import javax.validation.Valid;
+import javax.validation.constraints.Digits;
+import lombok.AllArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+/*
+CREATE TABLE `fn_user_role` (
+        `user_id` int(10) NOT NULL,
+        `role_id` int(10) NOT NULL,
+        `priority` decimal(4,0) DEFAULT NULL,
+        `app_id` int(11) NOT NULL DEFAULT 2,
+        PRIMARY KEY (`user_id`,`role_id`,`app_id`),
+        KEY `fn_user_role_role_id` (`role_id`) USING BTREE,
+        KEY `fn_user_role_user_id` (`user_id`) USING BTREE,
+        KEY `fk_fn_user__ref_178_fn_app_idx` (`app_id`),
+        CONSTRAINT `fk_fn_user__ref_172_fn_user` FOREIGN KEY (`user_id`) REFERENCES `fn_user` (`user_id`),
+        CONSTRAINT `fk_fn_user__ref_175_fn_role` FOREIGN KEY (`role_id`) REFERENCES `fn_role` (`role_id`),
+        CONSTRAINT `fk_fn_user__ref_178_fn_app` FOREIGN KEY (`app_id`) REFERENCES `fn_app` (`app_id`)
+        )
+*/
+
+@NamedNativeQueries({
+        @NamedNativeQuery(
+                name = "FnUserRole.retrieveUserRoleOnUserIdAndRoleIdAndAppId",
+                query = "select * from FnUserRole where user_id= :userId"
+                        + " and role_id= :roleId"
+                        + " and app_id= :appId"),
+        @NamedNativeQuery(
+                name = "FnUserRole.retrieveCachedAppRolesForUser",
+                query = "select * from FnUserRole where user_id= :userId"
+                        + " and user_id= :userId"
+                        + " and app_id= :appId")
+})
+
+@Table(
+        name = "fn_user_role",
+        indexes = {
+                @Index(name = "fn_user_role_role_id", columnList = "role_id"),
+                @Index(name = "fn_user_role_user_id", columnList = "user_id"),
+                @Index(name = "fk_fn_user__ref_178_fn_app_idx", columnList = "app_id")},
+        uniqueConstraints = {
+                @UniqueConstraint(name = "fn_user_role_id", columnNames = {"role_id", "user_id", "app_id"})
+        })
+@NoArgsConstructor
+@AllArgsConstructor
+@EqualsAndHashCode
+@Getter
+@Setter
+@Entity
+public class FnUserRole {
+
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "id", columnDefinition = "int(11) auto_increment")
+       private Long id;
+       @ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
+       @JoinColumn(name = "user_id")
+       @Valid
+       private FnUser userId;
+       @OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
+       @JoinColumn(name = "role_id")
+       @Valid
+       private FnRole roleId;
+       @Column(name = "priority", length = 4, columnDefinition = "decimal(4,0) DEFAULT NULL")
+       @Digits(integer = 4, fraction = 0)
+       private Long priority;
+       @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+       @JoinColumn(name = "app_Id")
+       @Valid
+       private FnApp appId;
+}
\ No newline at end of file
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnWorkflow.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnWorkflow.java
new file mode 100644 (file)
index 0000000..da8619d
--- /dev/null
@@ -0,0 +1,136 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.Table;
+import javax.persistence.UniqueConstraint;
+import javax.validation.constraints.Digits;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+/*
+CREATE TABLE `fn_workflow` (
+        `id` mediumint(9) NOT NULL AUTO_INCREMENT,
+        `name` varchar(20) NOT NULL,
+        `description` varchar(500) DEFAULT NULL,
+        `run_link` varchar(300) DEFAULT NULL,
+        `suspend_link` varchar(300) DEFAULT NULL,
+        `modified_link` varchar(300) DEFAULT NULL,
+        `active_yn` varchar(300) DEFAULT NULL,
+        `created` varchar(300) DEFAULT NULL,
+        `created_by` int(11) DEFAULT NULL,
+        `modified` varchar(300) DEFAULT NULL,
+        `modified_by` int(11) DEFAULT NULL,
+        `workflow_key` varchar(50) DEFAULT NULL,
+        PRIMARY KEY (`id`),
+        UNIQUE KEY `name` (`name`)
+        )
+*/
+
+@Table(name = "fn_workflow", uniqueConstraints = {
+        @UniqueConstraint(name = "name", columnNames = "name")
+})
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+@Entity
+public class FnWorkflow {
+       @Id
+       @GeneratedValue(strategy = GenerationType.AUTO)
+       @Column(name = "id", nullable = false, length = 9, columnDefinition = "mediumint(9) AUTO_INCREMENT")
+       @Digits(integer = 9, fraction = 0)
+       private Integer id;
+       @Column(name = "name", length = 20, nullable = false, unique = true)
+       @Size(max = 20)
+       @SafeHtml
+       @NotNull
+       private String name;
+       @Column(name = "description", length = 500, columnDefinition = "varchar(500) default null")
+       @Size(max = 500)
+       @SafeHtml
+       private String description;
+       @Column(name = "run_link", length = 300, columnDefinition = "varchar(300) default null")
+       @Size(max = 300)
+       @SafeHtml
+       private String runLink;
+       @Column(name = "suspend_link", length = 300, columnDefinition = "varchar(300) default null")
+       @Size(max = 300)
+       @SafeHtml
+       private String suspendLink;
+       @Column(name = "modified_link", length = 300, columnDefinition = "varchar(300) default null")
+       @Size(max = 300)
+       @SafeHtml
+       private String modifiedLink;
+       //TODO varchar(300)? Should be varchar(1)?
+       @Column(name = "active_yn", length = 300, columnDefinition = "varchar(300) default null")
+       @Size(max = 300)
+       @SafeHtml
+       private String activeYn;
+       @Column(name = "created", length = 300, columnDefinition = "varchar(300) default null")
+       @Size(max = 300)
+       @SafeHtml
+       private String created;
+       @Column(name = "created_by", length = 11, columnDefinition = "int(11) default null")
+       @Digits(integer = 11, fraction = 0)
+       private Integer created_by;
+       @Column(name = "modified", length = 300, columnDefinition = "varchar(300) default null")
+       @Size(max = 300)
+       @SafeHtml
+       private String modified;
+       @Column(name = "modified_by", length = 11, columnDefinition = "int(11) default null")
+       @Digits(integer = 11, fraction = 0)
+       private Integer modified_by;
+       @Column(name = "workflow_key", length = 50, columnDefinition = "varchar(50) default null")
+       @Size(max = 50)
+       @SafeHtml
+       private String workflowKey;
+
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/compositePK/FnQzTriggersId.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/compositePK/FnQzTriggersId.java
new file mode 100644 (file)
index 0000000..174a63b
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ * ============LICENSE_START==========================================
+ * ONAP Portal
+ * ===================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ===================================================================
+ *
+ * Unless otherwise specified, all software contained herein is licensed
+ * under the Apache License, Version 2.0 (the "License");
+ * you may not use this software except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Unless otherwise specified, all documentation contained herein is licensed
+ * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
+ * you may not use this documentation except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *             https://creativecommons.org/licenses/by/4.0/
+ *
+ * Unless required by applicable law or agreed to in writing, documentation
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * ============LICENSE_END============================================
+ *
+ *
+ */
+
+package org.onap.portal.domain.db.fn.compositePK;
+
+import java.io.Serializable;
+import java.util.Objects;
+import javax.validation.constraints.Size;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.hibernate.validator.constraints.SafeHtml;
+
+@Getter
+@Setter
+@NoArgsConstructor
+@AllArgsConstructor
+public final class FnQzTriggersId implements Serializable {
+       @Size(max = 120)
+       @SafeHtml
+       private String schedName;
+       @Size(max = 200)
+       @SafeHtml
+       private String triggerName;
+       @Size(max = 200)
+       @SafeHtml
+       private String triggerGroup;
+
+       @Override
+       public boolean equals(Object o) {
+              if (this == o) {
+                     return true;
+              }
+              if (!(o instanceof FnQzTriggersId)) {
+                     return false;
+              }
+              FnQzTriggersId that = (FnQzTriggersId) o;
+              return schedName.equals(that.schedName) &&
+                      triggerName.equals(that.triggerName) &&
+                      triggerGroup.equals(that.triggerGroup);
+       }
+
+       @Override
+       public int hashCode() {
+              return Objects.hash(schedName, triggerName, triggerGroup);
+       }
+}
\ No newline at end of file
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/dto/DomainVo.java b/portal-BE/src/main/java/org/onap/portal/domain/dto/DomainVo.java
new file mode 100644 (file)
index 0000000..6006a1b
--- /dev/null
@@ -0,0 +1,71 @@
+package org.onap.portal.domain.dto;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Set;
+import javax.persistence.Inheritance;
+import javax.persistence.InheritanceType;
+import lombok.AllArgsConstructor;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.onap.portal.domain.db.fn.FnUser;
+import org.onap.portalsdk.core.domain.FusionVo;
+
+@Getter
+@Setter
+@EqualsAndHashCode(callSuper = true)
+@NoArgsConstructor
+@AllArgsConstructor
+@Inheritance(strategy = InheritanceType.JOINED)
+public class DomainVo extends FusionVo implements Serializable, Cloneable, Comparable {
+       private static final long serialVersionUID = 1L;
+       protected Long id;
+       protected Date created;
+       protected Date modified;
+       protected FnUser createdId;
+       protected FnUser modifiedId;
+       protected Long rowNum;
+       protected Serializable auditUserId;
+       protected Set auditTrail = null;
+
+       @Override
+       public int compareTo(Object obj) {
+              Long c1 = this.getId();
+              Long c2 = ((org.onap.portalsdk.core.domain.support.DomainVo)obj).getId();
+              return c1 != null && c2 != null ? c1.compareTo(c2) : 1;
+       }
+
+       public Object copy(boolean isIdNull) {
+              ByteArrayOutputStream baos = null;
+              ByteArrayInputStream bais = null;
+              ObjectOutputStream oos = null;
+              ObjectInputStream ois = null;
+              DomainVo newVo = null;
+
+              try {
+                     baos = new ByteArrayOutputStream();
+                     oos = new ObjectOutputStream(baos);
+                     oos.writeObject(this);
+                     bais = new ByteArrayInputStream(baos.toByteArray());
+                     ois = new ObjectInputStream(bais);
+                     newVo = (DomainVo)ois.readObject();
+                     if (isIdNull) {
+                            newVo.setId(null);
+                     }
+              } catch (Exception var8) {
+                     var8.printStackTrace();
+              }
+
+              return newVo;
+       }
+
+       public Object clone() throws CloneNotSupportedException {
+              return super.clone();
+       }
+}
index 8b13789..27893d8 100644 (file)
@@ -1 +1,10 @@
-
+spring.jpa.database=mysql
+spring.jpa.show-sql=true
+spring.jpa.hibernate.ddl-auto=update
+spring.h2.console.enabled=true
+spring.datasource.url=jdbc:h2:mem:testdb
+spring.datasource.driverClassName=org.h2.Driver
+spring.datasource.username=sa
+spring.datasource.password=password
+spring.datasource.initialization-mode=always
+spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
\ No newline at end of file