Hibernate db fix 75/94275/1
authorDominik Mizyn <d.mizyn@samsung.com>
Mon, 26 Aug 2019 11:42:05 +0000 (13:42 +0200)
committerDominik Mizyn <d.mizyn@samsung.com>
Mon, 26 Aug 2019 12:35:31 +0000 (14:35 +0200)
Hibernate db fix + tests up

Issue-ID: PORTAL-710
Signed-off-by: Dominik Mizyn <d.mizyn@samsung.com>
Change-Id: I9b799399c08918322e9665e44b42b2e59bb7420b

63 files changed:
portal-BE/src/main/java/org/onap/portal/aop/service/FnUserServiceAOP.java
portal-BE/src/main/java/org/onap/portal/controller/LanguageController.java
portal-BE/src/main/java/org/onap/portal/dao/fn/FnLuTimezoneDao.java
portal-BE/src/main/java/org/onap/portal/domain/builder/FnUserBuilder.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/builder/FnUserDtoBuilder.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrFavoriteReports.java
portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrFolder.java
portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrLuFileType.java
portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrReport.java
portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrReportAccess.java
portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrReportFileHistory.java
portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrReportSchedule.java
portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrReportScheduleUsers.java
portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrTableRole.java
portal-BE/src/main/java/org/onap/portal/domain/db/cr/CrTableSource.java
portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpAppFunction.java
portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpBasicAuthAccount.java
portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpEndpoints.java
portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpMicroservice.java
portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpMicroserviceParameter.java
portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpMlModel.java
portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpMlRec.java
portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpMlUser.java
portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpNotification.java
portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpUserRolesRequest.java
portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpWidgetCatalog.java
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnApp.java
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnAuditLog.java
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnFunction.java
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLanguage.java
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLuActivity.java
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLuAlertMethod.java
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLuMenuSet.java
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLuTabSet.java
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnLuTimezone.java
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnMenu.java
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnMenuFunctional.java
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnOrg.java
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzBlobTriggers.java
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzCalendars.java
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzCronTriggers.java
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzFiredTriggers.java
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzJobDetails.java
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzLocks.java
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzPausedTriggerGrps.java
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzSchedulerState.java
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzSimpleTriggers.java
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnQzSimpropTriggers.java
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnRestrictedUrl.java
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnRole.java
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnTab.java
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnTabSelected.java
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnUser.java
portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnUserRole.java
portal-BE/src/main/java/org/onap/portal/domain/dto/DomainVo.java
portal-BE/src/main/java/org/onap/portal/domain/dto/fn/FnLanguageDto.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/dto/fn/FnUserDto.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/mapper/FnLanguageMapper.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/domain/mapper/FnUserMapper.java [new file with mode: 0644]
portal-BE/src/main/java/org/onap/portal/service/fn/FnLuTimezoneService.java
portal-BE/src/main/java/org/onap/portal/service/fn/FnUserService.java
portal-BE/src/test/java/org/onap/portal/controller/LanguageControllerTest.java
portal-BE/src/test/java/org/onap/portal/service/fn/FnUserServiceTest.java

index 0cb17cc..84f430e 100644 (file)
@@ -1,3 +1,43 @@
+/*
+ * ============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.aop.service;
 
 import java.security.Principal;
@@ -6,6 +46,8 @@ import javax.validation.ConstraintViolation;
 import org.aspectj.lang.annotation.Aspect;
 import org.aspectj.lang.annotation.Before;
 import org.onap.portal.domain.db.fn.FnUser;
+import org.onap.portal.domain.mapper.FnUserMapper;
+import org.onap.portal.service.fn.FnUserService;
 import org.onap.portal.validation.DataValidator;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -15,23 +57,42 @@ import org.springframework.stereotype.Component;
 @Aspect
 @Component
 public class FnUserServiceAOP {
+
        private static final Logger LOGGER = LoggerFactory.getLogger(FnLanguageServiceAOP.class);
 
+       private final DataValidator dataValidator;
+       private final FnUserMapper fnUserMapper;
+       private final FnUserService fnUserService;
+
        @Autowired
-       private DataValidator dataValidator;
+       public FnUserServiceAOP(final DataValidator dataValidator, final FnUserMapper fnUserMapper,
+               final FnUserService fnUserService) {
+              this.dataValidator = dataValidator;
+              this.fnUserMapper = fnUserMapper;
+              this.fnUserService = fnUserService;
+       }
 
        @Before("execution(* org.onap.portal.service.fn.FnUserService.saveFnUser(..)) && args(principal, fnUser)")
        public void save(final Principal principal, final FnUser fnUser) {
+              FnUser user;
               if (fnUser == null) {
                      LOGGER.error("User " + principal.getName() + " try to save NULL fnUser");
                      throw new NullPointerException("FnUser cannot be null or empty");
               }
-              if (!dataValidator.isValid(fnUser)) {
-                     String violations = dataValidator.getConstraintViolations(fnUser).stream()
+              try {
+                     user = fnUserMapper.fnUserToFnUser(fnUser);
+              } catch (NullPointerException e) {
+                     throw new NullPointerException(e.getLocalizedMessage() + ", " + e.getMessage());
+              }
+
+              if (!dataValidator.isValid(user)) {
+                     String violations = dataValidator.getConstraintViolations(user).stream()
                              .map(ConstraintViolation::getMessage)
                              .collect(Collectors.joining(", "));
                      LOGGER.error("User " + principal.getName() + " try to save not valid fnUser: " + violations);
                      throw new IllegalArgumentException("FnUser is not valid, " + violations);
+              } else {
+                     LOGGER.error("User " + principal.getName() + " send valid fnUser");
               }
        }
 }
index adee349..8f2e50e 100644 (file)
@@ -47,6 +47,9 @@ import org.onap.portal.domain.db.fn.FnLanguage;
 import org.onap.portal.domain.db.fn.FnUser;
 import org.onap.portal.domain.dto.PortalRestResponse;
 import org.onap.portal.domain.dto.PortalRestStatusEnum;
+import org.onap.portal.domain.dto.fn.FnLanguageDto;
+import org.onap.portal.domain.mapper.FnLanguageMapper;
+import org.onap.portal.domain.mapper.FnUserMapper;
 import org.onap.portal.service.fn.FnLanguageService;
 import org.onap.portal.service.fn.FnUserService;
 import org.slf4j.Logger;
@@ -69,33 +72,47 @@ public class LanguageController {
        private final FnLanguageService languageService;
        private final FnUserService fnUserService;
 
+       private final FnUserMapper fnUserMapper;
+       private final FnLanguageMapper fnLanguageMapper;
+
        @Autowired
        public LanguageController(final FnLanguageService languageService,
-               final FnUserService fnUserService) {
+               final FnUserService fnUserService, final FnUserMapper fnUserMapper,
+               final FnLanguageMapper fnLanguageMapper) {
               this.languageService = languageService;
               this.fnUserService = fnUserService;
+              this.fnUserMapper = fnUserMapper;
+              this.fnLanguageMapper = fnLanguageMapper;
        }
 
        @GetMapping(value = "/language", produces = MediaType.APPLICATION_JSON_VALUE)
-       public List<FnLanguage> getLanguageList(final Principal principal) {
-              return languageService.getLanguages(principal);
+       public List<FnLanguageDto> getLanguageList(final Principal principal) {
+              return fnLanguageMapper.fnLanguageListToDtoList(languageService.getLanguages(principal));
        }
 
        @PostMapping(value = "/languageSetting/user/{loginId}")
        public PortalRestResponse<String> setUpUserLanguage(Principal principal, @RequestBody FnLanguage fnLanguage,
                @PathVariable("loginId") Long userId) {
               PortalRestResponse<String> response = new PortalRestResponse<>();
+              LOGGER.info("User " + principal.getName() + " try to setUpUserLanguage fnUser with id " + userId);
               try {
-                     if (fnUserService.getUser(userId).isPresent()) {
+                     if (fnUserService.existById(userId)) {
+                            LOGGER.info("User " + principal.getName() + " found fnUser with id " + userId);
+                            @SuppressWarnings("OptionalGetWithoutIsPresent")
                             FnUser user = fnUserService.getUser(userId).get();
                             user.setLanguageId(fnLanguage);
                             fnUserService.saveFnUser(principal, user);
+                            //response.setResponse(fnUserMapper.fnUserToFnUserDto(user).toString());
+                            response.setMessage("SUCCESS");
+                            response.setStatus(PortalRestStatusEnum.OK);
+                     } else {
+                            response.setMessage("FAILURE");
+                            response.setResponse("User for id:" + userId + " do not exist");
+                            response.setStatus(PortalRestStatusEnum.ERROR);
                      }
-                     response.setMessage("SUCCESS");
-                     response.setStatus(PortalRestStatusEnum.OK);
               } catch (Exception e) {
                      response.setMessage("FAILURE");
-                     response.setResponse(e.getMessage());
+                     response.setResponse(e.toString());
                      response.setStatus(PortalRestStatusEnum.ERROR);
                      return response;
               }
index eca61dd..d98d893 100644 (file)
@@ -47,6 +47,6 @@ import org.springframework.transaction.annotation.Transactional;
 
 @Repository
 @Transactional
-public interface FnLuTimezoneDao extends JpaRepository<FnLuTimezone, Integer> {
+public interface FnLuTimezoneDao extends JpaRepository<FnLuTimezone, Long> {
 
 }
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/builder/FnUserBuilder.java b/portal-BE/src/main/java/org/onap/portal/domain/builder/FnUserBuilder.java
new file mode 100644 (file)
index 0000000..fe8aadb
--- /dev/null
@@ -0,0 +1,470 @@
+/*
+ * ============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.builder;
+
+import java.time.LocalDateTime;
+import java.util.Set;
+import java.util.UUID;
+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 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.db.fn.FnAuditLog;
+import org.onap.portal.domain.db.fn.FnLanguage;
+import org.onap.portal.domain.db.fn.FnLuAlertMethod;
+import org.onap.portal.domain.db.fn.FnLuTimezone;
+import org.onap.portal.domain.db.fn.FnMenuFunctional;
+import org.onap.portal.domain.db.fn.FnOrg;
+import org.onap.portal.domain.db.fn.FnPersUserAppSel;
+import org.onap.portal.domain.db.fn.FnRole;
+import org.onap.portal.domain.db.fn.FnUser;
+import org.onap.portal.domain.db.fn.FnUserRole;
+import org.springframework.stereotype.Component;
+
+@Component
+public class FnUserBuilder {
+
+       private @Digits(integer = 11, fraction = 0) Long userId;
+       private @Valid FnOrg orgId;
+       private @Valid FnUser managerId;
+       private @Size(max = 50)
+       @SafeHtml String firstName;
+       private @Size(max = 50)
+       @SafeHtml String middleName;
+       private @Size(max = 50)
+       @SafeHtml String lastName;
+       private @Size(max = 25)
+       @SafeHtml String phone;
+       private @Size(max = 25)
+       @SafeHtml String fax;
+       private @Size(max = 25)
+       @SafeHtml String cellular;
+       private @Size(max = 50) @Email
+       @SafeHtml String email;
+       private @Digits(integer = 11, fraction = 0) Long addressId;
+       private FnLuAlertMethod alertMethodCd;
+       private @Size(max = 20)
+       @SafeHtml String hrid;
+       private @Size(max = 20)
+       @SafeHtml String orgUserId;
+       private @Size(max = 30)
+       @SafeHtml String org_code;
+       private @Size(max = 25)
+       @SafeHtml String loginId;
+       private @Size(max = 100)
+       @SafeHtml String loginPwd;
+       private @PastOrPresent LocalDateTime lastLoginDate;
+       private @Size(max = 1)
+       @SafeHtml
+       @NotNull(message = "activeYn must not be null") String activeYn;
+       private @Valid FnUser createdId;
+       private @PastOrPresent LocalDateTime createdDate;
+       private @Valid FnUser modifiedId;
+       private @PastOrPresent LocalDateTime modifiedDate;
+       private @Size(max = 1)
+       @SafeHtml
+       @NotNull(message = "isInternalYn must not be null") String isInternalYn;
+       private @Size(max = 100)
+       @SafeHtml String addressLine1;
+       private @Size(max = 100)
+       @SafeHtml String addressLine2;
+       private @Size(max = 50)
+       @SafeHtml String city;
+       private @Size(max = 3)
+       @SafeHtml String stateCd;
+       private @Size(max = 11)
+       @SafeHtml String zipCode;
+       private @Size(max = 3)
+       @SafeHtml String countryCd;
+       private @Size(max = 8)
+       @SafeHtml String locationClli;
+       private @Size(max = 20)
+       @SafeHtml String orgManagerUserId;
+       private @Size(max = 100)
+       @SafeHtml String company;
+       private @Size(max = 200)
+       @SafeHtml String departmentName;
+       private @Size(max = 100)
+       @SafeHtml String jobTitle;
+       private @Valid FnLuTimezone timezone;
+       private @Size(max = 25)
+       @SafeHtml String department;
+       private @Size(max = 25)
+       @SafeHtml String businessUnit;
+       private @Size(max = 100)
+       @SafeHtml String businessUnitName;
+       private @Size(max = 25)
+       @SafeHtml String cost_center;
+       private @Size(max = 10)
+       @SafeHtml String finLocCode;
+       private @Size(max = 10)
+       @SafeHtml String siloStatus;
+       private @Valid @NotNull(message = "languageId must not be null") FnLanguage languageId;
+       private @NotNull(message = "guest must not be null") boolean guest;
+       private Set<CrReportFileHistory> crReportFileHistorie;
+       private Set<FnRole> fnRoles;
+       private Set<FnMenuFunctional> fnRoleList;
+       private Set<FnAuditLog> fnAuditLogs;
+       private Set<FnUser> fnUsersCreatedId;
+       private Set<FnUser> fnUsersManagerId;
+       private Set<FnUser> fnUsersModifiedId;
+       private Set<EpUserRolesRequest> epUserRolesRequests;
+       private Set<FnPersUserAppSel> persUserAppSels;
+       private Set<EpWidgetCatalogParameter> epWidgetCatalogParameters;
+       private Set<EpPersUserWidgetPlacement> epPersUserWidgetPlacements;
+       private Set<EpPersUserWidgetSel> epPersUserWidgetSels;
+       private Set<FnUserRole> fnUserRoles;
+       private Set<EpUserNotification> epUserNotifications;
+
+       public FnUserBuilder setUserId(@Digits(integer = 11, fraction = 0) Long userId) {
+              this.userId = userId;
+              return this;
+       }
+
+       public FnUserBuilder setOrgId(@Valid FnOrg orgId) {
+              this.orgId = orgId;
+              return this;
+       }
+
+       public FnUserBuilder setManagerId(@Valid FnUser managerId) {
+              this.managerId = managerId;
+              return this;
+       }
+
+       public FnUserBuilder setFirstName(@Size(max = 50) @SafeHtml String firstName) {
+              this.firstName = firstName;
+              return this;
+       }
+
+       public FnUserBuilder setMiddleName(@Size(max = 50) @SafeHtml String middleName) {
+              this.middleName = middleName;
+              return this;
+       }
+
+       public FnUserBuilder setLastName(@Size(max = 50) @SafeHtml String lastName) {
+              this.lastName = lastName;
+              return this;
+       }
+
+       public FnUserBuilder setPhone(@Size(max = 25) @SafeHtml String phone) {
+              this.phone = phone;
+              return this;
+       }
+
+       public FnUserBuilder setFax(@Size(max = 25) @SafeHtml String fax) {
+              this.fax = fax;
+              return this;
+       }
+
+       public FnUserBuilder setCellular(@Size(max = 25) @SafeHtml String cellular) {
+              this.cellular = cellular;
+              return this;
+       }
+
+       public FnUserBuilder setEmail(@Size(max = 50) @Email @SafeHtml String email) {
+              this.email = email;
+              return this;
+       }
+
+       public FnUserBuilder setAddressId(@Digits(integer = 11, fraction = 0) Long addressId) {
+              this.addressId = addressId;
+              return this;
+       }
+
+       public FnUserBuilder setAlertMethodCd(FnLuAlertMethod alertMethodCd) {
+              this.alertMethodCd = alertMethodCd;
+              return this;
+       }
+
+       public FnUserBuilder setHrid(@Size(max = 20) @SafeHtml String hrid) {
+              this.hrid = hrid;
+              return this;
+       }
+
+       public FnUserBuilder setOrgUserId(@Size(max = 20) @SafeHtml String orgUserId) {
+              this.orgUserId = orgUserId;
+              return this;
+       }
+
+       public FnUserBuilder setOrg_code(@Size(max = 30) @SafeHtml String org_code) {
+              this.org_code = org_code;
+              return this;
+       }
+
+       public FnUserBuilder setLoginId(@Size(max = 25) @SafeHtml String loginId) {
+              this.loginId = loginId;
+              return this;
+       }
+
+       public FnUserBuilder setLoginPwd(@Size(max = 100) @SafeHtml String loginPwd) {
+              this.loginPwd = loginPwd;
+              return this;
+       }
+
+       public FnUserBuilder setLastLoginDate(@PastOrPresent LocalDateTime lastLoginDate) {
+              this.lastLoginDate = lastLoginDate;
+              return this;
+       }
+
+       public FnUserBuilder setActiveYn(
+               @Size(max = 1) @SafeHtml @NotNull(message = "activeYn must not be null") String activeYn) {
+              this.activeYn = activeYn;
+              return this;
+       }
+
+       public FnUserBuilder setCreatedId(@Valid FnUser createdId) {
+              this.createdId = createdId;
+              return this;
+       }
+
+       public FnUserBuilder setCreatedDate(@PastOrPresent LocalDateTime createdDate) {
+              this.createdDate = createdDate;
+              return this;
+       }
+
+       public FnUserBuilder setModifiedId(@Digits(integer = 11, fraction = 0) FnUser modifiedId) {
+              this.modifiedId = modifiedId;
+              return this;
+       }
+
+       public FnUserBuilder setModifiedDate(@PastOrPresent LocalDateTime modifiedDate) {
+              this.modifiedDate = modifiedDate;
+              return this;
+       }
+
+       public FnUserBuilder setIsInternalYn(
+               @Size(max = 1) @SafeHtml @NotNull(message = "isInternalYn must not be null") String isInternalYn) {
+              this.isInternalYn = isInternalYn;
+              return this;
+       }
+
+       public FnUserBuilder setAddressLine1(@Size(max = 100) @SafeHtml String addressLine1) {
+              this.addressLine1 = addressLine1;
+              return this;
+       }
+
+       public FnUserBuilder setAddressLine2(@Size(max = 100) @SafeHtml String addressLine2) {
+              this.addressLine2 = addressLine2;
+              return this;
+       }
+
+       public FnUserBuilder setCity(@Size(max = 50) @SafeHtml String city) {
+              this.city = city;
+              return this;
+       }
+
+       public FnUserBuilder setStateCd(@Size(max = 3) @SafeHtml String stateCd) {
+              this.stateCd = stateCd;
+              return this;
+       }
+
+       public FnUserBuilder setZipCode(@Size(max = 11) @SafeHtml String zipCode) {
+              this.zipCode = zipCode;
+              return this;
+       }
+
+       public FnUserBuilder setCountryCd(@Size(max = 3) @SafeHtml String countryCd) {
+              this.countryCd = countryCd;
+              return this;
+       }
+
+       public FnUserBuilder setLocationClli(@Size(max = 8) @SafeHtml String locationClli) {
+              this.locationClli = locationClli;
+              return this;
+       }
+
+       public FnUserBuilder setOrgManagerUserId(@Size(max = 20) @SafeHtml String orgManagerUserId) {
+              this.orgManagerUserId = orgManagerUserId;
+              return this;
+       }
+
+       public FnUserBuilder setCompany(@Size(max = 100) @SafeHtml String company) {
+              this.company = company;
+              return this;
+       }
+
+       public FnUserBuilder setDepartmentName(@Size(max = 200) @SafeHtml String departmentName) {
+              this.departmentName = departmentName;
+              return this;
+       }
+
+       public FnUserBuilder setJobTitle(@Size(max = 100) @SafeHtml String jobTitle) {
+              this.jobTitle = jobTitle;
+              return this;
+       }
+
+       public FnUserBuilder setTimezone(@Valid FnLuTimezone timezone) {
+              this.timezone = timezone;
+              return this;
+       }
+
+       public FnUserBuilder setDepartment(@Size(max = 25) @SafeHtml String department) {
+              this.department = department;
+              return this;
+       }
+
+       public FnUserBuilder setBusinessUnit(@Size(max = 25) @SafeHtml String businessUnit) {
+              this.businessUnit = businessUnit;
+              return this;
+       }
+
+       public FnUserBuilder setBusinessUnitName(@Size(max = 100) @SafeHtml String businessUnitName) {
+              this.businessUnitName = businessUnitName;
+              return this;
+       }
+
+       public FnUserBuilder setCost_center(@Size(max = 25) @SafeHtml String cost_center) {
+              this.cost_center = cost_center;
+              return this;
+       }
+
+       public FnUserBuilder setFinLocCode(@Size(max = 10) @SafeHtml String finLocCode) {
+              this.finLocCode = finLocCode;
+              return this;
+       }
+
+       public FnUserBuilder setSiloStatus(@Size(max = 10) @SafeHtml String siloStatus) {
+              this.siloStatus = siloStatus;
+              return this;
+       }
+
+       public FnUserBuilder setLanguageId(
+               @Valid @NotNull(message = "languageId must not be null") FnLanguage languageId) {
+              this.languageId = languageId;
+              return this;
+       }
+
+       public FnUserBuilder setGuest(@NotNull(message = "guest must not be null") boolean guest) {
+              this.guest = guest;
+              return this;
+       }
+
+       public FnUserBuilder setCrReportFileHistorie(Set<CrReportFileHistory> crReportFileHistorie) {
+              this.crReportFileHistorie = crReportFileHistorie;
+              return this;
+       }
+
+       public FnUserBuilder setFnRoles(Set<FnRole> fnRoles) {
+              this.fnRoles = fnRoles;
+              return this;
+       }
+
+       public FnUserBuilder setFnRoleList(Set<FnMenuFunctional> fnRoleList) {
+              this.fnRoleList = fnRoleList;
+              return this;
+       }
+
+       public FnUserBuilder setFnAuditLogs(Set<FnAuditLog> fnAuditLogs) {
+              this.fnAuditLogs = fnAuditLogs;
+              return this;
+       }
+
+       public FnUserBuilder setFnUsersCreatedId(Set<FnUser> fnUsersCreatedId) {
+              this.fnUsersCreatedId = fnUsersCreatedId;
+              return this;
+       }
+
+       public FnUserBuilder setFnUsersManagerId(Set<FnUser> fnUsersManagerId) {
+              this.fnUsersManagerId = fnUsersManagerId;
+              return this;
+       }
+
+       public FnUserBuilder setFnUsersModifiedId(Set<FnUser> fnUsersModifiedId) {
+              this.fnUsersModifiedId = fnUsersModifiedId;
+              return this;
+       }
+
+       public FnUserBuilder setEpUserRolesRequests(Set<EpUserRolesRequest> epUserRolesRequests) {
+              this.epUserRolesRequests = epUserRolesRequests;
+              return this;
+       }
+
+       public FnUserBuilder setPersUserAppSels(Set<FnPersUserAppSel> persUserAppSels) {
+              this.persUserAppSels = persUserAppSels;
+              return this;
+       }
+
+       public FnUserBuilder setEpWidgetCatalogParameters(Set<EpWidgetCatalogParameter> epWidgetCatalogParameters) {
+              this.epWidgetCatalogParameters = epWidgetCatalogParameters;
+              return this;
+       }
+
+       public FnUserBuilder setEpPersUserWidgetPlacements(Set<EpPersUserWidgetPlacement> epPersUserWidgetPlacements) {
+              this.epPersUserWidgetPlacements = epPersUserWidgetPlacements;
+              return this;
+       }
+
+       public FnUserBuilder setEpPersUserWidgetSels(Set<EpPersUserWidgetSel> epPersUserWidgetSels) {
+              this.epPersUserWidgetSels = epPersUserWidgetSels;
+              return this;
+       }
+
+       public FnUserBuilder setFnUserRoles(Set<FnUserRole> fnUserRoles) {
+              this.fnUserRoles = fnUserRoles;
+              return this;
+       }
+
+       public FnUserBuilder setEpUserNotifications(Set<EpUserNotification> epUserNotifications) {
+              this.epUserNotifications = epUserNotifications;
+              return this;
+       }
+
+       public FnUser createFnUser() {
+              return new FnUser(userId, orgId, managerId, firstName, middleName, lastName, phone, fax, cellular, email,
+                      addressId, alertMethodCd, hrid, orgUserId, org_code, loginId, loginPwd, lastLoginDate, activeYn,
+                      createdId, createdDate, modifiedId, modifiedDate, isInternalYn, addressLine1, addressLine2, city,
+                      stateCd, zipCode, countryCd, locationClli, orgManagerUserId, company, departmentName, jobTitle,
+                      timezone, department, businessUnit, businessUnitName, cost_center, finLocCode, siloStatus,
+                      languageId, guest, crReportFileHistorie, fnRoles, fnRoleList, fnAuditLogs, fnUsersCreatedId,
+                      fnUsersManagerId, fnUsersModifiedId, epUserRolesRequests, persUserAppSels,
+                      epWidgetCatalogParameters, epPersUserWidgetPlacements, epPersUserWidgetSels, fnUserRoles,
+                      epUserNotifications);
+       }
+}
\ No newline at end of file
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/builder/FnUserDtoBuilder.java b/portal-BE/src/main/java/org/onap/portal/domain/builder/FnUserDtoBuilder.java
new file mode 100644 (file)
index 0000000..c6075dd
--- /dev/null
@@ -0,0 +1,331 @@
+/*
+ * ============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.builder;
+
+import java.time.LocalDateTime;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.onap.portal.domain.dto.fn.FnUserDto;
+import org.springframework.stereotype.Component;
+
+@Component
+@NoArgsConstructor
+@AllArgsConstructor
+@Getter
+@Setter
+public class FnUserDtoBuilder {
+
+       private Long userId;
+       private Long orgId;
+       private Long managerId;
+       private String firstName;
+       private String middleName;
+       private String lastName;
+       private String phone;
+       private String fax;
+       private String cellular;
+       private String email;
+       private Long addressId;
+       private String alertMethodCd;
+       private String hrid;
+       private String orgUserId;
+       private String org_code;
+       private String loginId;
+       private String loginPwd;
+       private LocalDateTime lastLoginDate;
+       private String activeYn;
+       private Long createdId;
+       private LocalDateTime createdDate;
+       private Long modifiedId;
+       private LocalDateTime modifiedDate;
+       private String isInternalYn;
+       private String addressLine1;
+       private String addressLine2;
+       private String city;
+       private String stateCd;
+       private String zipCode;
+       private String countryCd;
+       private String locationClli;
+       private String orgManagerUserId;
+       private String company;
+       private String departmentName;
+       private String jobTitle;
+       private Long timezone;
+       private String department;
+       private String businessUnit;
+       private String businessUnitName;
+       private String cost_center;
+       private String finLocCode;
+       private String siloStatus;
+       private Long languageId;
+       private boolean guest;
+
+       public FnUserDtoBuilder setUserId(Long userId) {
+              this.userId = userId;
+              return this;
+       }
+
+       public FnUserDtoBuilder setOrgId(Long orgId) {
+              this.orgId = orgId;
+              return this;
+       }
+
+       public FnUserDtoBuilder setManagerId(Long managerId) {
+              this.managerId = managerId;
+              return this;
+       }
+
+       public FnUserDtoBuilder setFirstName(String firstName) {
+              this.firstName = firstName;
+              return this;
+       }
+
+       public FnUserDtoBuilder setMiddleName(String middleName) {
+              this.middleName = middleName;
+              return this;
+       }
+
+       public FnUserDtoBuilder setLastName(String lastName) {
+              this.lastName = lastName;
+              return this;
+       }
+
+       public FnUserDtoBuilder setPhone(String phone) {
+              this.phone = phone;
+              return this;
+       }
+
+       public FnUserDtoBuilder setFax(String fax) {
+              this.fax = fax;
+              return this;
+       }
+
+       public FnUserDtoBuilder setCellular(String cellular) {
+              this.cellular = cellular;
+              return this;
+       }
+
+       public FnUserDtoBuilder setEmail(String email) {
+              this.email = email;
+              return this;
+       }
+
+       public FnUserDtoBuilder setAddressId(Long addressId) {
+              this.addressId = addressId;
+              return this;
+       }
+
+       public FnUserDtoBuilder setAlertMethodCd(String alertMethodCd) {
+              this.alertMethodCd = alertMethodCd;
+              return this;
+       }
+
+       public FnUserDtoBuilder setHrid(String hrid) {
+              this.hrid = hrid;
+              return this;
+       }
+
+       public FnUserDtoBuilder setOrgUserId(String orgUserId) {
+              this.orgUserId = orgUserId;
+              return this;
+       }
+
+       public FnUserDtoBuilder setOrg_code(String org_code) {
+              this.org_code = org_code;
+              return this;
+       }
+
+       public FnUserDtoBuilder setLoginId(String loginId) {
+              this.loginId = loginId;
+              return this;
+       }
+
+       public FnUserDtoBuilder setLoginPwd(String loginPwd) {
+              this.loginPwd = loginPwd;
+              return this;
+       }
+
+       public FnUserDtoBuilder setLastLoginDate(LocalDateTime lastLoginDate) {
+              this.lastLoginDate = lastLoginDate;
+              return this;
+       }
+
+       public FnUserDtoBuilder setActiveYn(String activeYn) {
+              this.activeYn = activeYn;
+              return this;
+       }
+
+       public FnUserDtoBuilder setCreatedId(Long createdId) {
+              this.createdId = createdId;
+              return this;
+       }
+
+       public FnUserDtoBuilder setCreatedDate(LocalDateTime createdDate) {
+              this.createdDate = createdDate;
+              return this;
+       }
+
+       public FnUserDtoBuilder setModifiedId(Long modifiedId) {
+              this.modifiedId = modifiedId;
+              return this;
+       }
+
+       public FnUserDtoBuilder setModifiedDate(LocalDateTime modifiedDate) {
+              this.modifiedDate = modifiedDate;
+              return this;
+       }
+
+       public FnUserDtoBuilder setIsInternalYn(String isInternalYn) {
+              this.isInternalYn = isInternalYn;
+              return this;
+       }
+
+       public FnUserDtoBuilder setAddressLine1(String addressLine1) {
+              this.addressLine1 = addressLine1;
+              return this;
+       }
+
+       public FnUserDtoBuilder setAddressLine2(String addressLine2) {
+              this.addressLine2 = addressLine2;
+              return this;
+       }
+
+       public FnUserDtoBuilder setCity(String city) {
+              this.city = city;
+              return this;
+       }
+
+       public FnUserDtoBuilder setStateCd(String stateCd) {
+              this.stateCd = stateCd;
+              return this;
+       }
+
+       public FnUserDtoBuilder setZipCode(String zipCode) {
+              this.zipCode = zipCode;
+              return this;
+       }
+
+       public FnUserDtoBuilder setCountryCd(String countryCd) {
+              this.countryCd = countryCd;
+              return this;
+       }
+
+       public FnUserDtoBuilder setLocationClli(String locationClli) {
+              this.locationClli = locationClli;
+              return this;
+       }
+
+       public FnUserDtoBuilder setOrgManagerUserId(String orgManagerUserId) {
+              this.orgManagerUserId = orgManagerUserId;
+              return this;
+       }
+
+       public FnUserDtoBuilder setCompany(String company) {
+              this.company = company;
+              return this;
+       }
+
+       public FnUserDtoBuilder setDepartmentName(String departmentName) {
+              this.departmentName = departmentName;
+              return this;
+       }
+
+       public FnUserDtoBuilder setJobTitle(String jobTitle) {
+              this.jobTitle = jobTitle;
+              return this;
+       }
+
+       public FnUserDtoBuilder setTimezone(Long timezone) {
+              this.timezone = timezone;
+              return this;
+       }
+
+       public FnUserDtoBuilder setDepartment(String department) {
+              this.department = department;
+              return this;
+       }
+
+       public FnUserDtoBuilder setBusinessUnit(String businessUnit) {
+              this.businessUnit = businessUnit;
+              return this;
+       }
+
+       public FnUserDtoBuilder setBusinessUnitName(String businessUnitName) {
+              this.businessUnitName = businessUnitName;
+              return this;
+       }
+
+       public FnUserDtoBuilder setCost_center(String cost_center) {
+              this.cost_center = cost_center;
+              return this;
+       }
+
+       public FnUserDtoBuilder setFinLocCode(String finLocCode) {
+              this.finLocCode = finLocCode;
+              return this;
+       }
+
+       public FnUserDtoBuilder setSiloStatus(String siloStatus) {
+              this.siloStatus = siloStatus;
+              return this;
+       }
+
+       public FnUserDtoBuilder setLanguageId(Long languageId) {
+              this.languageId = languageId;
+              return this;
+       }
+
+       public FnUserDtoBuilder setGuest(boolean guest) {
+              this.guest = guest;
+              return this;
+       }
+
+       public FnUserDto createFnUserDto() {
+              return new FnUserDto(userId, orgId, managerId, firstName, middleName, lastName, phone, fax, cellular,
+                      email, addressId, alertMethodCd, hrid, orgUserId, org_code, loginId, loginPwd, lastLoginDate,
+                      activeYn, createdId, createdDate, modifiedId, modifiedDate, isInternalYn, addressLine1,
+                      addressLine2, city, stateCd, zipCode, countryCd, locationClli, orgManagerUserId, company,
+                      departmentName, jobTitle, timezone, department, businessUnit, businessUnitName, cost_center,
+                      finLocCode, siloStatus, languageId, guest);
+       }
+}
\ No newline at end of file
index 2fab70e..a1d4a9a 100644 (file)
@@ -69,7 +69,7 @@ CREATE TABLE `cr_favorite_reports` (
 @Table(name = "cr_favorite_reports")
 @NoArgsConstructor
 @AllArgsConstructor
-@EqualsAndHashCode
+
 @Getter
 @Setter
 @IdClass(CrFavoriteReportsId.class)
index a2c4240..1791eae 100644 (file)
@@ -41,8 +41,7 @@
 package org.onap.portal.domain.db.cr;
 
 import java.time.LocalDateTime;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.Set;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -128,5 +127,5 @@ public class CrFolder {
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<CrFolder> crFolders = new ArrayList<>();
+       private Set<CrFolder> crFolders;
 }
index 4638460..83c2866 100644 (file)
 package org.onap.portal.domain.db.cr;
 
 import java.util.ArrayList;
-import java.util.List;
+import java.util.Set;
 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;
@@ -106,6 +104,6 @@ public class CrLuFileType {
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<CrReportFileHistory> crReportFileHistories = new ArrayList<>();
+       private Set<CrReportFileHistory> crReportFileHistories;
 
 }
index c25f806..16b0512 100644 (file)
@@ -42,8 +42,7 @@ package org.onap.portal.domain.db.cr;
 
 import java.io.Serializable;
 import java.time.LocalDateTime;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.Set;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Embeddable;
@@ -96,7 +95,7 @@ CREATE TABLE `cr_report` (
 })
 @NoArgsConstructor
 @AllArgsConstructor
-@EqualsAndHashCode
+
 @Getter
 @Setter
 @Entity
@@ -206,34 +205,34 @@ public class CrReport implements Serializable {
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<CrReportSchedule> crReportSchedules = new ArrayList<>();
+       private Set<CrReportSchedule> crReportSchedules;
        @OneToMany(
                targetEntity = CrReportAccess.class,
                mappedBy = "repId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<CrReportAccess> crReportAccesses = new ArrayList<>();
+       private Set<CrReportAccess> crReportAccesses;
        @OneToMany(
                targetEntity = CrReportLog.class,
                mappedBy = "repId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<CrReportLog> crReportLogs = new ArrayList<>();
+       private Set<CrReportLog> crReportLogs;
        @OneToMany(
                targetEntity = CrReportEmailSentLog.class,
                mappedBy = "repId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<CrReportEmailSentLog> crReportEmailSentLogs = new ArrayList<>();
+       private Set<CrReportEmailSentLog> crReportEmailSentLogs;
        @OneToMany(
                targetEntity = CrReportFileHistory.class,
                mappedBy = "repId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<CrReportFileHistory> crReportFileHistories = new ArrayList<>();
+       private Set<CrReportFileHistory> crReportFileHistories;
 
 }
index 44a53d3..2eb50c7 100644 (file)
@@ -80,7 +80,7 @@ CREATE TABLE `cr_report_access` (
 @Table(name = "cr_report_access")
 @NoArgsConstructor
 @AllArgsConstructor
-@EqualsAndHashCode
+
 @Getter
 @Setter
 @Entity
index 049057d..53daa68 100644 (file)
@@ -43,6 +43,7 @@ package org.onap.portal.domain.db.cr;
 import java.time.LocalDateTime;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Set;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -176,5 +177,5 @@ public class CrReportFileHistory {
                joinColumns = {@JoinColumn(name = "hist_id", referencedColumnName = "hist_id")},
                inverseJoinColumns = {@JoinColumn(name = "user_id", referencedColumnName = "user_id")}
        )
-       private List<FnUser> fnUserList = new ArrayList<>();
+       private Set<FnUser> fnUserList;
 }
index f3935ff..6d09aa4 100644 (file)
@@ -41,8 +41,7 @@
 package org.onap.portal.domain.db.cr;
 
 import java.time.LocalDateTime;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.Set;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -183,5 +182,5 @@ public class CrReportSchedule {
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<CrReportScheduleUsers> crReportScheduleUsers = new ArrayList<>();
+       private Set<CrReportScheduleUsers> crReportScheduleUsers;
 }
index 76c213c..b607671 100644 (file)
@@ -78,7 +78,7 @@ CREATE TABLE `cr_report_schedule_users` (
 @Table(name = "cr_report_schedule_users")
 @NoArgsConstructor
 @AllArgsConstructor
-@EqualsAndHashCode
+
 @Getter
 @Setter
 @Entity
index 9487b97..445e87a 100644 (file)
@@ -73,7 +73,7 @@ CREATE TABLE `cr_table_role` (
 @Table(name = "cr_table_role")
 @NoArgsConstructor
 @AllArgsConstructor
-@EqualsAndHashCode
+
 @Getter
 @Setter
 @Entity
index a98999b..b37b2c0 100644 (file)
@@ -42,6 +42,7 @@ package org.onap.portal.domain.db.cr;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Set;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -116,19 +117,19 @@ public class CrTableSource {
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<CrTableJoin> crTableJoins = new ArrayList<>();
+       private Set<CrTableJoin> crTableJoins;
        @OneToMany(
                targetEntity = CrTableJoin.class,
                mappedBy = "destTableName",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<CrTableJoin> crTableJoins1 = new ArrayList<>();
+       private Set<CrTableJoin> crTableJoins1;
        @OneToMany(
                targetEntity = CrTableRole.class,
                mappedBy = "tableName",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<CrTableRole> crTableRoles = new ArrayList<>();
+       private Set<CrTableRole> crTableRoles;
 }
index cae3b3b..0f2f950 100644 (file)
@@ -41,8 +41,7 @@
 package org.onap.portal.domain.db.ep;
 
 import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.Set;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -78,7 +77,7 @@ CREATE TABLE `ep_app_function` (
 */
 
 @Table(name = "ep_app_function", indexes = {@Index(name = "fk_ep_app_function_app_id", columnList = "app_id")})
-@EqualsAndHashCode
+
 @Getter
 @Setter
 @Entity
@@ -108,7 +107,7 @@ public class EpAppFunction {
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<EpAppRoleFunction> epAppRoleFunctions = new ArrayList<>();
+       private Set<EpAppRoleFunction> epAppRoleFunctions;
 
        @Getter
        @Setter
index a8e0874..130e987 100644 (file)
@@ -40,8 +40,7 @@
 
 package org.onap.portal.domain.db.ep;
 
-import java.util.ArrayList;
-import java.util.List;
+import java.util.Set;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -110,5 +109,5 @@ public class EpBasicAuthAccount {
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<EpEndpointsBasicAuthAccount> epEndpointsBasicAuthAccounts = new ArrayList<>();
+       private Set<EpEndpointsBasicAuthAccount> epEndpointsBasicAuthAccounts;
 }
index 5ab4cb9..ed1fabd 100644 (file)
@@ -40,8 +40,7 @@
 
 package org.onap.portal.domain.db.ep;
 
-import java.util.ArrayList;
-import java.util.List;
+import java.util.Set;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -95,6 +94,6 @@ public class EpEndpoints {
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<EpEndpointsBasicAuthAccount> epEndpointsBasicAuthAccounts = new ArrayList<>();
+       private Set<EpEndpointsBasicAuthAccount> epEndpointsBasicAuthAccounts;
 
 }
index 35e51be..aa43fbe 100644 (file)
@@ -40,8 +40,7 @@
 
 package org.onap.portal.domain.db.ep;
 
-import java.util.ArrayList;
-import java.util.List;
+import java.util.Set;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -90,7 +89,7 @@ CREATE TABLE `ep_microservice` (
 })
 @NoArgsConstructor
 @AllArgsConstructor
-@ToString
+
 @Getter
 @Setter
 @Entity
@@ -136,14 +135,14 @@ public class EpMicroservice {
        @SafeHtml
        private String active;
        @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
-       private List<EpWidgetCatalog> epWidgetCatalogList = new ArrayList<>();
+       private Set<EpWidgetCatalog> epWidgetCatalogList;
        @OneToMany(
                targetEntity = EpMicroserviceParameter.class,
                mappedBy = "serviceId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<EpMicroserviceParameter> epMicroserviceParameters = new ArrayList<>();
+       private Set<EpMicroserviceParameter> epMicroserviceParameters;
 
        public void copyOf(final EpMicroservice epMicroservice) {
               this.id = epMicroservice.getId();
index 51ca6f2..c66ca72 100644 (file)
@@ -40,8 +40,7 @@
 
 package org.onap.portal.domain.db.ep;
 
-import java.util.ArrayList;
-import java.util.List;
+import java.util.Set;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -88,7 +87,7 @@ CREATE TABLE `ep_microservice_parameter` (
 })
 @NoArgsConstructor
 @AllArgsConstructor
-@ToString
+
 @Getter
 @Setter
 @Entity
@@ -116,6 +115,6 @@ public class EpMicroserviceParameter {
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<EpWidgetCatalogParameter> epWidgetCatalogParameters = new ArrayList<>();
+       private Set<EpWidgetCatalogParameter> epWidgetCatalogParameter;
 
 }
index 270c992..d865fa4 100644 (file)
@@ -69,7 +69,7 @@ CREATE TABLE `ep_ml_model` (
 @Table(name = "ep_ml_model")
 @NoArgsConstructor
 @AllArgsConstructor
-@EqualsAndHashCode
+
 @Getter
 @Setter
 @Entity
index 2ed3f13..190405c 100644 (file)
@@ -70,7 +70,7 @@ CREATE TABLE `ep_ml_rec` (
 @Table(name = "ep_ml_rec")
 @NoArgsConstructor
 @AllArgsConstructor
-@EqualsAndHashCode
+
 @Getter
 @Setter
 @Entity
index 0f17d25..59ff560 100644 (file)
@@ -72,7 +72,7 @@ CREATE TABLE `ep_ml_user` (
 @Table(name = "ep_ml_user")
 @NoArgsConstructor
 @AllArgsConstructor
-@EqualsAndHashCode
+
 @Getter
 @Setter
 @Entity
index 4fe24bd..12c161f 100644 (file)
@@ -41,8 +41,7 @@
 package org.onap.portal.domain.db.ep;
 
 import java.time.LocalDateTime;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.Set;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -148,12 +147,12 @@ public class EpNotification {
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<EpRoleNotification> epRoleNotifications = new ArrayList<>();
+       private Set<EpRoleNotification> epRoleNotifications;
        @OneToMany(
                targetEntity = EpUserNotification.class,
                mappedBy = "notificationId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<EpUserNotification> epUserNotifications = new ArrayList<>();
+       private Set<EpUserNotification> epUserNotifications;
 }
index 0d8bfc8..13d26f7 100644 (file)
@@ -41,8 +41,7 @@
 package org.onap.portal.domain.db.ep;
 
 import java.time.LocalDateTime;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.Set;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -122,5 +121,5 @@ public class EpUserRolesRequest {
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<EpUserRolesRequestDet> epUserRolesRequestDets = new ArrayList<>();
+       private Set<EpUserRolesRequestDet> epUserRolesRequestDets;
 }
index 7bfbee8..a125e1d 100644 (file)
@@ -40,8 +40,7 @@
 
 package org.onap.portal.domain.db.ep;
 
-import java.util.ArrayList;
-import java.util.List;
+import java.util.Set;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -122,40 +121,40 @@ public class EpWidgetCatalog {
                        @Index(name = "FK_EP_WIDGET_MICROSERVICE_EP_WIDGET", columnList = "widget_id")
                }
        )
-       private List<EpMicroservice> epMicroservices = new ArrayList<>();
+       private Set<EpMicroservice> epMicroservices;
        @OneToMany(
                targetEntity = EpWidgetCatalogRole.class,
                mappedBy = "widgetId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<EpWidgetCatalogRole> widgetCatalogRoles = new ArrayList<>();
+       private Set<EpWidgetCatalogRole> widgetCatalogRoles;
        @OneToMany(
                targetEntity = EpPersUserWidgetSel.class,
                mappedBy = "widgetId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<EpPersUserWidgetSel> epPersUserWidgetSels = new ArrayList<>();
+       private Set<EpPersUserWidgetSel> epPersUserWidgetSels;
        @OneToMany(
                targetEntity = EpPersUserWidgetSel.class,
                mappedBy = "widgetId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<EpPersUserWidgetSel> persUserWidgetSels = new ArrayList<>();
+       private Set<EpPersUserWidgetSel> persUserWidgetSels;
        @OneToMany(
                targetEntity = EpPersUserWidgetPlacement.class,
                mappedBy = "widgetId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<EpPersUserWidgetPlacement> epPersUserWidgetPlacements = new ArrayList<>();
+       private Set<EpPersUserWidgetPlacement> epPersUserWidgetPlacements;
        @OneToMany(
                targetEntity = EpWidgetCatalogParameter.class,
                mappedBy = "widgetId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<EpWidgetCatalogParameter> epWidgetCatalogParameters = new ArrayList<>();
+       private Set<EpWidgetCatalogParameter> epWidgetCatalogParameters;
 }
index 84f6aea..cdc2089 100644 (file)
@@ -41,8 +41,7 @@
 package org.onap.portal.domain.db.fn;
 
 import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.Set;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Embeddable;
@@ -227,61 +226,61 @@ public class FnApp extends DomainVo implements Serializable {
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<FnMenuFunctionalRoles> fnMenuFunctionalRoles = new ArrayList<>();
+       private Set<FnMenuFunctionalRoles> fnMenuFunctionalRoles;
        @OneToMany(
                targetEntity = EpUserRolesRequest.class,
                mappedBy = "appId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<EpUserRolesRequest> epUserRolesRequests = new ArrayList<>();
+       private Set<EpUserRolesRequest> epUserRolesRequests;
        @OneToMany(
                targetEntity = EpAppFunction.class,
                mappedBy = "appId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<EpAppFunction> epAppFunctions = new ArrayList<>();
+       private Set<EpAppFunction> epAppFunctions;
        @OneToMany(
                targetEntity = EpAppRoleFunction.class,
                mappedBy = "appId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<EpAppRoleFunction> epAppRoleFunctions = new ArrayList<>();
+       private Set<EpAppRoleFunction> epAppRoleFunctions;
        @OneToMany(
                targetEntity = FnUserRole.class,
                mappedBy = "appId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<FnUserRole> fnUserRoles = new ArrayList<>();
+       private Set<FnUserRole> fnUserRoles;
        @OneToMany(
                targetEntity = EpWebAnalyticsSource.class,
                mappedBy = "appId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<EpWebAnalyticsSource> epWebAnalyticsSources = new ArrayList<>();
+       private Set<EpWebAnalyticsSource> epWebAnalyticsSources;
        @OneToMany(
                targetEntity = EpWidgetCatalogRole.class,
                mappedBy = "appId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<EpWidgetCatalogRole> epWidgetCatalogRoles = new ArrayList<>();
+       private Set<EpWidgetCatalogRole> epWidgetCatalogRoles;
        @OneToMany(
                targetEntity = EpMicroservice.class,
                mappedBy = "appId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<EpMicroservice> epMicroservices = new ArrayList<>();
+       private Set<EpMicroservice> epMicroservices;
        @OneToMany(
                targetEntity = FnPersUserAppSel.class,
                mappedBy = "appId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<FnPersUserAppSel> fnPersUserAppSels = new ArrayList<>();
+       private Set<FnPersUserAppSel> fnPersUserAppSels;
 }
index 8f5e5c0..469fb74 100644 (file)
@@ -94,7 +94,7 @@ public class FnAuditLog {
        @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)
+       @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
        @JoinColumn(name = "user_id", nullable = false)
        @NotNull
        @Valid
index 1635351..41ac1d6 100644 (file)
@@ -40,8 +40,7 @@
 
 package org.onap.portal.domain.db.fn;
 
-import java.util.ArrayList;
-import java.util.List;
+import java.util.Set;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -88,19 +87,19 @@ public class FnFunction {
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<FnRestrictedUrl> fnRestrictedUrls = new ArrayList<>();
+       private Set<FnRestrictedUrl> fnRestrictedUrls;
        @OneToMany(
                targetEntity = FnRoleFunction.class,
                mappedBy = "functionCd",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<FnRoleFunction> fnRoleFunctions = new ArrayList<>();
+       private Set<FnRoleFunction> fnRoleFunctions;
        @OneToMany(
                targetEntity = FnTab.class,
                mappedBy = "functionCd",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<FnTab> fnTabs = new ArrayList<>();
+       private Set<FnTab> fnTabs;
 }
index d9aff94..a5255f3 100644 (file)
@@ -41,8 +41,7 @@
 package org.onap.portal.domain.db.fn;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.Set;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -74,7 +73,7 @@ CREATE TABLE `fn_language` (
 @Table(name = "fn_language")
 @NoArgsConstructor
 @AllArgsConstructor
-@ToString
+
 @Getter
 @Setter
 @Entity
@@ -101,8 +100,17 @@ public class FnLanguage {
                targetEntity = FnUser.class,
                mappedBy = "languageId",
                cascade = CascadeType.ALL,
-               fetch = FetchType.EAGER
+               fetch = FetchType.LAZY
        )
-       private List<FnUser> fnUsers = new ArrayList<>();
+       private Set<FnUser> fnUsers;
 
+       @Override
+       public String toString() {
+              final StringBuilder sb = new StringBuilder("FnLanguage{");
+              sb.append("languageId=").append(languageId);
+              sb.append(", languageName='").append(languageName).append('\'');
+              sb.append(", languageAlias='").append(languageAlias).append('\'');
+              sb.append('}');
+              return sb.toString();
+       }
 }
index dc5c7e2..6b0b47c 100644 (file)
@@ -40,8 +40,7 @@
 
 package org.onap.portal.domain.db.fn;
 
-import java.util.ArrayList;
-import java.util.List;
+import java.util.Set;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -89,5 +88,5 @@ public class FnLuActivity {
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<FnAuditLog> fnAuditLogs = new ArrayList<>();
+       private Set<FnAuditLog> fnAuditLogs;
 }
index bc3ef68..6ee0716 100644 (file)
@@ -40,8 +40,7 @@
 
 package org.onap.portal.domain.db.fn;
 
-import java.util.ArrayList;
-import java.util.List;
+import java.util.Set;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -89,5 +88,5 @@ public class FnLuAlertMethod {
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<FnUser> fnUsers = new ArrayList<>();
+       private Set<FnUser> fnUsers;
 }
index 5f3459d..3ac8823 100644 (file)
@@ -40,8 +40,7 @@
 
 package org.onap.portal.domain.db.fn;
 
-import java.util.ArrayList;
-import java.util.List;
+import java.util.Set;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -93,5 +92,5 @@ public class FnLuMenuSet {
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<FnMenu> fnMenus = new ArrayList<>();
+       private Set<FnMenu> fnMenus;
 }
index 7c9743a..c8c7be2 100644 (file)
@@ -40,8 +40,7 @@
 
 package org.onap.portal.domain.db.fn;
 
-import java.util.ArrayList;
-import java.util.List;
+import java.util.Set;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -88,5 +87,5 @@ public class FnLuTabSet {
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<FnTab> fnTabs = new ArrayList<>();
+       private Set<FnTab> fnTabs;
 }
index b43474f..53b54f4 100644 (file)
@@ -40,8 +40,7 @@
 
 package org.onap.portal.domain.db.fn;
 
-import java.util.ArrayList;
-import java.util.List;
+import java.util.Set;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -78,7 +77,7 @@ public class FnLuTimezone {
        @Id
        @GeneratedValue(strategy = GenerationType.AUTO)
        @Column(name = "timezone_id", length = 11, nullable = false)
-       private Integer timezoneId;
+       private Long timezoneId;
        @Column(name = "timezone_name", length = 100, nullable = false)
        @Size(max = 100)
        @SafeHtml
@@ -96,6 +95,6 @@ public class FnLuTimezone {
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<FnUser> fnUsers = new ArrayList<>();
+       private Set<FnUser> fnUsers;
 
 }
index 007d6ed..3ba60c7 100644 (file)
@@ -40,8 +40,7 @@
 
 package org.onap.portal.domain.db.fn;
 
-import java.util.ArrayList;
-import java.util.List;
+import java.util.Set;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -112,7 +111,7 @@ public class FnMenu {
        @Size(max = 100)
        @SafeHtml
        private String label;
-       @ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
        @JoinColumn(name = "parent_Id", columnDefinition = "int(11) DEFAULT NULL")
        @Valid
        private FnMenu parentId;
@@ -171,5 +170,5 @@ public class FnMenu {
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<FnMenu> fnMenus = new ArrayList<>();
+       private Set<FnMenu> fnMenus;
 }
index bfdc673..cd9a362 100644 (file)
@@ -40,8 +40,7 @@
 
 package org.onap.portal.domain.db.fn;
 
-import java.util.ArrayList;
-import java.util.List;
+import java.util.Set;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -134,26 +133,26 @@ public class FnMenuFunctional {
                        @Index(name = "sys_c0014619", columnList = "menu_id")
                }
        )
-       private List<FnUser> fnUsers = new ArrayList<>();
+       private Set<FnUser> fnUsers;
        @OneToMany(
                targetEntity = FnMenuFunctionalAncestors.class,
                mappedBy = "menuId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<FnMenuFunctionalAncestors> fnMenuFunctionalAncestorsMenuId = new ArrayList<>();
+       private Set<FnMenuFunctionalAncestors> fnMenuFunctionalAncestorsMenuId;
        @OneToMany(
                targetEntity = FnMenuFunctionalAncestors.class,
                mappedBy = "ancestorMenuId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<FnMenuFunctionalAncestors> fnMenuFunctionalsAncestorMenuId = new ArrayList<>();
+       private Set<FnMenuFunctionalAncestors> fnMenuFunctionalsAncestorMenuId;
        @OneToMany(
                targetEntity = FnMenuFunctionalRoles.class,
                mappedBy = "menuId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<FnMenuFunctionalRoles> fnMenuFunctionalRoles = new ArrayList<>();
+       private Set<FnMenuFunctionalRoles> fnMenuFunctionalRoles;
 }
index 44a5e84..14bd194 100644 (file)
@@ -40,8 +40,7 @@
 
 package org.onap.portal.domain.db.fn;
 
-import java.util.ArrayList;
-import java.util.List;
+import java.util.Set;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -77,7 +76,7 @@ CREATE TABLE `fn_org` (
 })
 @NoArgsConstructor
 @AllArgsConstructor
-@ToString
+
 @Getter
 @Setter
 @Entity
@@ -86,7 +85,7 @@ public class FnOrg {
        @GeneratedValue(strategy = GenerationType.AUTO)
        @Column(name = "org_id", nullable = false, length = 11)
        @Digits(integer = 11, fraction = 0)
-       private Integer orgId;
+       private Long orgId;
        @Column(name = "org_name", length = 50, nullable = false)
        @Size(max = 50)
        @SafeHtml
@@ -103,5 +102,5 @@ public class FnOrg {
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<FnUser> fnUsers = new ArrayList<>();
+       private Set<FnUser> fnUsers;
 }
index f901474..d13ac34 100644 (file)
@@ -68,7 +68,7 @@ CREATE TABLE `fn_qz_calendars` (
 @Table(name = "fn_qz_calendars")
 @NoArgsConstructor
 @AllArgsConstructor
-@EqualsAndHashCode
+
 @Getter
 @Setter
 @Entity
index 21ae8dd..82968f4 100644 (file)
@@ -73,7 +73,7 @@ CREATE TABLE `fn_qz_cron_triggers` (
 @Table(name = "fn_qz_cron_triggers")
 @NoArgsConstructor
 @AllArgsConstructor
-@EqualsAndHashCode
+
 @Getter
 @Setter
 @Entity
index 11ab511..0442635 100644 (file)
@@ -41,8 +41,7 @@
 package org.onap.portal.domain.db.fn;
 
 import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.Set;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -86,7 +85,7 @@ CREATE TABLE `fn_qz_job_details` (
 })
 @NoArgsConstructor
 @AllArgsConstructor
-@EqualsAndHashCode
+
 @Getter
 @Setter
 @Entity
@@ -145,7 +144,7 @@ public class FnQzJobDetails {
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<FnQzTriggers> selectedTabCd = new ArrayList<>();
+       private Set<FnQzTriggers> selectedTabCd;
 
        @Getter
        @Setter
index 1d9fc48..cee0eba 100644 (file)
@@ -66,7 +66,7 @@ CREATE TABLE `fn_qz_locks` (
 @Table(name = "fn_qz_locks")
 @NoArgsConstructor
 @AllArgsConstructor
-@EqualsAndHashCode
+
 @Getter
 @Setter
 @Entity
index a7bcdb3..38c6540 100644 (file)
@@ -66,7 +66,7 @@ CREATE TABLE `fn_qz_paused_trigger_grps` (
 @Table(name = "fn_qz_paused_trigger_grps")
 @NoArgsConstructor
 @AllArgsConstructor
-@EqualsAndHashCode
+
 @Getter
 @Setter
 @Entity
index e19c216..b9005a6 100644 (file)
@@ -71,7 +71,7 @@ CREATE TABLE `fn_qz_scheduler_state` (
 @Table(name = "fn_qz_scheduler_state")
 @NoArgsConstructor
 @AllArgsConstructor
-@EqualsAndHashCode
+
 @Getter
 @Setter
 @Entity
index f3f9a94..23ca4c3 100644 (file)
@@ -76,7 +76,7 @@ CREATE TABLE `fn_qz_simple_triggers` (
 @Table(name = "fn_qz_simple_triggers")
 @NoArgsConstructor
 @AllArgsConstructor
-@EqualsAndHashCode
+
 @Getter
 @Setter
 @Entity
index cef8f48..23a3e06 100644 (file)
@@ -83,7 +83,7 @@ CREATE TABLE `fn_qz_simprop_triggers` (
 @Table(name = "fn_qz_simprop_triggers")
 @NoArgsConstructor
 @AllArgsConstructor
-@EqualsAndHashCode
+
 @Getter
 @Setter
 @Entity
index dc45788..eda3fb2 100644 (file)
@@ -40,8 +40,7 @@
 
 package org.onap.portal.domain.db.fn;
 
-import java.util.ArrayList;
-import java.util.List;
+import java.util.Set;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -154,7 +153,7 @@ public class FnRole {
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<FnRoleFunction> fnRoleFunctions = new ArrayList<>();
+       private Set<FnRoleFunction> fnRoleFunctions;
        @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
        @JoinTable(
                name = "fn_user_pseudo_role",
@@ -164,7 +163,7 @@ public class FnRole {
                        @Index(name = "fk_pseudo_role_user_id", columnList = "user_id")
                }
        )
-       private List<FnUser> fnUsers = new ArrayList<>();
+       private Set<FnUser> fnUsers;
        @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
        @JoinTable(
                name = "fn_role_composite",
@@ -174,49 +173,50 @@ public class FnRole {
                        @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<>();
+       private Set<FnRole> fnRoles;
+       @ManyToMany(cascade = CascadeType.ALL,
+               fetch = FetchType.LAZY)
+       private Set<FnRole> fnRoleList;
        @OneToMany(
                targetEntity = EpRoleNotification.class,
                mappedBy = "notificationID",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<EpRoleNotification> epRoleNotifications = new ArrayList<>();
+       private Set<EpRoleNotification> epRoleNotifications;
        @OneToMany(
                targetEntity = FnMenuFunctionalRoles.class,
                mappedBy = "roleId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<FnMenuFunctionalRoles> fnMenuFunctionalRoles = new ArrayList<>();
+       private Set<FnMenuFunctionalRoles> fnMenuFunctionalRoles;
        @OneToMany(
                targetEntity = EpWidgetCatalogRole.class,
                mappedBy = "roleId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<EpWidgetCatalogRole> epWidgetCatalogRoles = new ArrayList<>();
+       private Set<EpWidgetCatalogRole> epWidgetCatalogRoles;
        @OneToMany(
                targetEntity = EpAppRoleFunction.class,
                mappedBy = "fnRole",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<EpAppRoleFunction> epAppRoleFunctions = new ArrayList<>();
+       private Set<EpAppRoleFunction> epAppRoleFunctions;
        @OneToMany(
                targetEntity = EpUserRolesRequestDet.class,
                mappedBy = "requestedRoleId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<EpUserRolesRequestDet> epUserRolesRequestDets = new ArrayList<>();
+       private Set<EpUserRolesRequestDet> epUserRolesRequestDets;
        @OneToMany(
                targetEntity = FnUserRole.class,
                mappedBy = "roleId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<FnUserRole> fnUserRoles = new ArrayList<>();
+       private Set<FnUserRole> fnUserRoles;
 }
index 020b310..bfc7834 100644 (file)
@@ -41,8 +41,7 @@
 package org.onap.portal.domain.db.fn;
 
 import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.Set;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
@@ -142,6 +141,6 @@ public class FnTab {
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<FnTabSelected> selectedTabCd = new ArrayList<>();
+       private Set<FnTabSelected> selectedTabCd;
 
 }
index 8f4c10b..f62668e 100644 (file)
@@ -73,7 +73,7 @@ CREATE TABLE `fn_tab_selected` (
 @Table(name = "fn_tab_selected")
 @NoArgsConstructor
 @AllArgsConstructor
-@EqualsAndHashCode
+
 @Getter
 @Setter
 @Entity
index 4747cdf..cbca44c 100644 (file)
@@ -41,9 +41,9 @@
 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.Set;
+import java.util.UUID;
 import java.util.stream.Collectors;
 import javax.persistence.CascadeType;
 import javax.persistence.Column;
@@ -59,22 +59,20 @@ import javax.persistence.ManyToOne;
 import javax.persistence.NamedNativeQueries;
 import javax.persistence.NamedNativeQuery;
 import javax.persistence.OneToMany;
-import javax.persistence.OneToOne;
 import javax.persistence.SequenceGenerator;
 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.Builder.Default;
 import lombok.Getter;
 import lombok.NoArgsConstructor;
 import lombok.Setter;
-import lombok.ToString;
+import org.hibernate.annotations.DynamicUpdate;
+import org.hibernate.annotations.GenericGenerator;
 import org.hibernate.validator.constraints.SafeHtml;
 import org.onap.portal.domain.db.cr.CrReportFileHistory;
 import org.onap.portal.domain.db.ep.EpPersUserWidgetPlacement;
@@ -82,7 +80,6 @@ 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;
@@ -170,13 +167,16 @@ CREATE TABLE `fn_user` (
         uniqueConstraints = {
                 @UniqueConstraint(name = "fn_user_hrid", columnNames = "hrid"),
                 @UniqueConstraint(name = "fn_user_login_id", columnNames = "login_id")
+
         })
-@NoArgsConstructor
-@AllArgsConstructor
+
 @Getter
 @Setter
 @Entity
-@SequenceGenerator(name="seq", initialValue=1000, allocationSize=100000)
+@NoArgsConstructor
+@AllArgsConstructor
+@DynamicUpdate
+@SequenceGenerator(name = "seq", initialValue = 1000, allocationSize = 100000)
 public class FnUser implements UserDetails {
 
        @Id
@@ -184,13 +184,11 @@ public class FnUser implements UserDetails {
        @Column(name = "user_id", length = 11, nullable = false)
        @Digits(integer = 11, fraction = 0)
        private Long userId;
-       @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
+       @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
        @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)
@@ -253,18 +251,16 @@ public class FnUser implements UserDetails {
        @Column(name = "active_yn", length = 1, columnDefinition = "character varying(1) default 'y'", nullable = false)
        @Size(max = 1)
        @SafeHtml
-       //@NotNull(message = "activeYn must not be null")
+       @NotNull(message = "activeYn must not be null")
        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
@@ -272,7 +268,7 @@ public class FnUser implements UserDetails {
        @Column(name = "is_internal_yn", length = 1, columnDefinition = "character varying(1) default 'n'", nullable = false)
        @Size(max = 1)
        @SafeHtml
-       //@NotNull(message = "isInternalYn must not be null")
+       @NotNull(message = "isInternalYn must not be null")
        private String isInternalYn;
        @Column(name = "address_line_1", length = 100, columnDefinition = "varchar(100) DEFAULT NULL")
        @Size(max = 100)
@@ -320,7 +316,6 @@ public class FnUser implements UserDetails {
        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)
@@ -346,97 +341,96 @@ public class FnUser implements UserDetails {
        @Size(max = 10)
        @SafeHtml
        private String siloStatus;
-       @ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
        @JoinColumn(name = "language_id", nullable = false, columnDefinition = "int(11) DEFAULT 1")
-       @Valid
-       //@NotNull(message = "languageId must not be null")
+       @NotNull(message = "languageId must not be null")
        private FnLanguage languageId;
        @Column(name = "is_guest", columnDefinition = "boolean default 0", nullable = false)
        @NotNull(message = "guest must not be null")
        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<>();
+       private Set<CrReportFileHistory> crReportFileHistorie;
+       @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+       private Set<FnRole> fnRoles;
        @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
-       private List<FnMenuFunctional> fnRoleList = new ArrayList<>();
+       private Set<FnMenuFunctional> fnRoleList;
        @OneToMany(
                targetEntity = FnAuditLog.class,
                mappedBy = "userId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<FnAuditLog> fnAuditLogs = new ArrayList<>();
+       private Set<FnAuditLog> fnAuditLogs;
        @OneToMany(
                targetEntity = FnUser.class,
                mappedBy = "createdId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<FnUser> fnUsersCreatedId = new ArrayList<>();
+       private Set<FnUser> fnUsersCreatedId;
        @OneToMany(
                targetEntity = FnUser.class,
                mappedBy = "managerId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<FnUser> fnUsersManagerId = new ArrayList<>();
+       private Set<FnUser> fnUsersManagerId;
        @OneToMany(
                targetEntity = FnUser.class,
                mappedBy = "modifiedId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<FnUser> fnUsersModifiedId = new ArrayList<>();
+       private Set<FnUser> fnUsersModifiedId;
        @OneToMany(
                targetEntity = EpUserRolesRequest.class,
                mappedBy = "userId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<EpUserRolesRequest> epUserRolesRequests = new ArrayList<>();
+       private Set<EpUserRolesRequest> epUserRolesRequests;
        @OneToMany(
                targetEntity = FnPersUserAppSel.class,
                mappedBy = "userId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<FnPersUserAppSel> persUserAppSels = new ArrayList<>();
+       private Set<FnPersUserAppSel> persUserAppSels;
        @OneToMany(
                targetEntity = EpWidgetCatalogParameter.class,
                mappedBy = "userId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<EpWidgetCatalogParameter> epWidgetCatalogParameters = new ArrayList<>();
+       private Set<EpWidgetCatalogParameter> epWidgetCatalogParameters;
        @OneToMany(
                targetEntity = EpPersUserWidgetPlacement.class,
                mappedBy = "userId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<EpPersUserWidgetPlacement> epPersUserWidgetPlacements = new ArrayList<>();
+       private Set<EpPersUserWidgetPlacement> epPersUserWidgetPlacements;
        @OneToMany(
                targetEntity = EpPersUserWidgetSel.class,
                mappedBy = "userId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<EpPersUserWidgetSel> epPersUserWidgetSels = new ArrayList<>();
+       private Set<EpPersUserWidgetSel> epPersUserWidgetSels;
        @OneToMany(
                targetEntity = FnUserRole.class,
                mappedBy = "userId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<FnUserRole> fnUserRoles = new ArrayList<>();
+       private Set<FnUserRole> fnUserRoles;
        @OneToMany(
                targetEntity = EpUserNotification.class,
                mappedBy = "userId",
                cascade = CascadeType.ALL,
                fetch = FetchType.LAZY
        )
-       private List<EpUserNotification> epUserNotifications = new ArrayList<>();
+       private Set<EpUserNotification> epUserNotifications;
 
        @Override
        public Collection<? extends GrantedAuthority> getAuthorities() {
index 2eecd74..fb23405 100644 (file)
@@ -103,7 +103,7 @@ CREATE TABLE `fn_user_role` (
         })
 @NoArgsConstructor
 @AllArgsConstructor
-@EqualsAndHashCode
+
 @Getter
 @Setter
 @Entity
@@ -113,11 +113,11 @@ public class FnUserRole {
        @GeneratedValue(strategy = GenerationType.AUTO)
        @Column(name = "id", columnDefinition = "int(11) auto_increment")
        private Long id;
-       @ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
+       @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
        @JoinColumn(name = "user_id")
        @Valid
        private FnUser userId;
-       @OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
+       @OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
        @JoinColumn(name = "role_id")
        @Valid
        private FnRole roleId;
index 305af8e..6c722bf 100644 (file)
@@ -1,3 +1,43 @@
+/*
+ * ============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.dto;
 
 import java.io.ByteArrayInputStream;
@@ -19,7 +59,7 @@ import org.onap.portalsdk.core.domain.FusionVo;
 
 @Getter
 @Setter
-@EqualsAndHashCode
+
 @NoArgsConstructor
 @AllArgsConstructor
 @Inheritance(strategy = InheritanceType.JOINED)
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/dto/fn/FnLanguageDto.java b/portal-BE/src/main/java/org/onap/portal/domain/dto/fn/FnLanguageDto.java
new file mode 100644 (file)
index 0000000..8dfbda5
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * ============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.dto.fn;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import lombok.ToString;
+
+@Setter
+@Getter
+@NoArgsConstructor
+@AllArgsConstructor
+
+public class FnLanguageDto {
+       private Long languageId;
+       private String languageName;
+       private String languageAlias;
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/dto/fn/FnUserDto.java b/portal-BE/src/main/java/org/onap/portal/domain/dto/fn/FnUserDto.java
new file mode 100644 (file)
index 0000000..0da1f59
--- /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.dto.fn;
+
+import java.time.LocalDateTime;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import lombok.ToString;
+
+@Setter
+@Getter
+
+@NoArgsConstructor
+@AllArgsConstructor
+public class FnUserDto {
+       private Long userId;
+       private Long orgId;
+       private Long managerId;
+       private String firstName;
+       private String middleName;
+       private String lastName;
+       private String phone;
+       private String fax;
+       private String cellular;
+       private String email;
+       private Long addressId;
+       private String alertMethodCd;
+       private String hrid;
+       private String orgUserId;
+       private String org_code;
+       private String loginId;
+       private String loginPwd;
+       protected LocalDateTime lastLoginDate;
+       private String activeYn;
+       private Long createdId;
+       protected LocalDateTime createdDate;
+       private Long modifiedId;
+       protected LocalDateTime modifiedDate;
+       private String isInternalYn = "n";
+       private String addressLine1;
+       private String addressLine2;
+       private String city;
+       private String stateCd;
+       private String zipCode;
+       private String countryCd;
+       private String locationClli;
+       private String orgManagerUserId;
+       private String company;
+       private String departmentName;
+       private String jobTitle;
+       private Long timezone;
+       private String department;
+       private String businessUnit;
+       private String businessUnitName;
+       private String cost_center;
+       private String finLocCode;
+       private String siloStatus;
+       private Long languageId;
+       private boolean guest;
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/mapper/FnLanguageMapper.java b/portal-BE/src/main/java/org/onap/portal/domain/mapper/FnLanguageMapper.java
new file mode 100644 (file)
index 0000000..b885bfd
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * ============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.mapper;
+
+import java.util.List;
+import java.util.stream.Collectors;
+import org.onap.portal.domain.db.fn.FnLanguage;
+import org.onap.portal.domain.dto.fn.FnLanguageDto;
+import org.springframework.stereotype.Component;
+
+@Component
+public class FnLanguageMapper {
+
+       public FnLanguageDto fnLanguageToDto(final FnLanguage fnLanguage){
+              FnLanguageDto dto = new FnLanguageDto();
+              dto.setLanguageId(fnLanguage.getLanguageId());
+              dto.setLanguageName(fnLanguage.getLanguageName());
+              dto.setLanguageAlias(fnLanguage.getLanguageAlias());
+              return dto;
+       }
+
+       public List<FnLanguageDto> fnLanguageListToDtoList(final List<FnLanguage> fnLanguages){
+              return fnLanguages.stream().map(this::fnLanguageToDto).collect(
+                      Collectors.toList());
+       }
+}
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/mapper/FnUserMapper.java b/portal-BE/src/main/java/org/onap/portal/domain/mapper/FnUserMapper.java
new file mode 100644 (file)
index 0000000..757eff5
--- /dev/null
@@ -0,0 +1,160 @@
+/*
+ * ============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.mapper;
+
+import lombok.NoArgsConstructor;
+import org.onap.portal.domain.builder.FnUserBuilder;
+import org.onap.portal.domain.builder.FnUserDtoBuilder;
+import org.onap.portal.domain.db.fn.FnUser;
+import org.onap.portal.domain.dto.fn.FnUserDto;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+@NoArgsConstructor
+public class FnUserMapper {
+
+       private FnUserDtoBuilder fnUserDtoBuilder;
+       private FnUserBuilder fnUserBuilder;
+
+       @Autowired
+       public FnUserMapper(final FnUserDtoBuilder fnUserDtoBuilder,
+               FnUserBuilder fnUserBuilder) {
+              this.fnUserDtoBuilder = fnUserDtoBuilder;
+              this.fnUserBuilder = fnUserBuilder;
+       }
+
+       public FnUserDto fnUserToFnUserDto(final FnUser fnUser){
+              return fnUserDtoBuilder
+                      .setUserId(fnUser.getUserId())
+                      .setOrgId(fnUser.getOrgId().getOrgId())
+                      .setManagerId(fnUser.getManagerId().getUserId())
+                      .setFirstName(fnUser.getFirstName())
+                      .setMiddleName(fnUser.getMiddleName())
+                      .setLastName(fnUser.getLastName())
+                      .setPhone(fnUser.getPhone())
+                      .setFax(fnUser.getFax())
+                      .setCellular(fnUser.getCellular())
+                      .setEmail(fnUser.getEmail())
+                      .setAddressId(fnUser.getAddressId())
+                      .setAlertMethodCd(fnUser.getAlertMethodCd().getAlertMethodCd())
+                      .setHrid(fnUser.getHrid())
+                      .setOrgUserId(fnUser.getOrgUserId())
+                      .setOrg_code(fnUser.getOrg_code())
+                      .setLoginId(fnUser.getLoginId())
+                      .setLoginPwd(fnUser.getLoginPwd())
+                      .setLastLoginDate(fnUser.getLastLoginDate())
+                      .setActiveYn(fnUser.getActiveYn())
+                      .setCreatedId(fnUser.getCreatedId().getUserId())
+                      .setCreatedDate(fnUser.getCreatedDate())
+                      .setModifiedId(fnUser.getModifiedId().getUserId())
+                      .setModifiedDate(fnUser.getModifiedDate())
+                      .setIsInternalYn(fnUser.getIsInternalYn())
+                      .setAddressLine1(fnUser.getAddressLine1())
+                      .setAddressLine2(fnUser.getAddressLine2())
+                      .setCity(fnUser.getCity())
+                      .setStateCd(fnUser.getStateCd())
+                      .setZipCode(fnUser.getZipCode())
+                      .setCountryCd(fnUser.getCountryCd())
+                      .setLocationClli(fnUser.getLocationClli())
+                      .setOrgManagerUserId(fnUser.getOrgManagerUserId())
+                      .setCompany(fnUser.getCompany())
+                      .setDepartmentName(fnUser.getDepartmentName())
+                      .setJobTitle(fnUser.getJobTitle())
+                      .setTimezone(fnUser.getTimezone().getTimezoneId())
+                      .setDepartment(fnUser.getDepartment())
+                      .setBusinessUnit(fnUser.getBusinessUnit())
+                      .setBusinessUnitName(fnUser.getBusinessUnitName())
+                      .setCost_center(fnUser.getCost_center())
+                      .setFinLocCode(fnUser.getFinLocCode())
+                      .setSiloStatus(fnUser.getSiloStatus())
+                      .setLanguageId(fnUser.getLanguageId().getLanguageId())
+                      .setGuest(fnUser.isGuest()).createFnUserDto();
+       }
+
+       public FnUser fnUserToFnUser(final FnUser fnUser){
+              return fnUserBuilder
+                      .setUserId(fnUser.getUserId())
+                      .setOrgId(fnUser.getOrgId())
+                      .setManagerId(fnUser.getManagerId())
+                      .setFirstName(fnUser.getFirstName())
+                      .setMiddleName(fnUser.getMiddleName())
+                      .setLastName(fnUser.getLastName())
+                      .setPhone(fnUser.getPhone())
+                      .setFax(fnUser.getFax())
+                      .setCellular(fnUser.getCellular())
+                      .setEmail(fnUser.getEmail())
+                      .setAddressId(fnUser.getAddressId())
+                      .setAlertMethodCd(fnUser.getAlertMethodCd())
+                      .setHrid(fnUser.getHrid())
+                      .setOrgUserId(fnUser.getOrgUserId())
+                      .setOrg_code(fnUser.getOrg_code())
+                      .setLoginId(fnUser.getLoginId())
+                      .setLoginPwd(fnUser.getLoginPwd())
+                      .setLastLoginDate(fnUser.getLastLoginDate())
+                      .setActiveYn(fnUser.getActiveYn())
+                      .setCreatedId(fnUser.getCreatedId())
+                      .setCreatedDate(fnUser.getCreatedDate())
+                      .setModifiedId(fnUser.getModifiedId())
+                      .setModifiedDate(fnUser.getModifiedDate())
+                      .setIsInternalYn(fnUser.getIsInternalYn())
+                      .setAddressLine1(fnUser.getAddressLine1())
+                      .setAddressLine2(fnUser.getAddressLine2())
+                      .setCity(fnUser.getCity())
+                      .setStateCd(fnUser.getStateCd())
+                      .setZipCode(fnUser.getZipCode())
+                      .setCountryCd(fnUser.getCountryCd())
+                      .setLocationClli(fnUser.getLocationClli())
+                      .setOrgManagerUserId(fnUser.getOrgManagerUserId())
+                      .setCompany(fnUser.getCompany())
+                      .setDepartmentName(fnUser.getDepartmentName())
+                      .setJobTitle(fnUser.getJobTitle())
+                      .setTimezone(fnUser.getTimezone())
+                      .setDepartment(fnUser.getDepartment())
+                      .setBusinessUnit(fnUser.getBusinessUnit())
+                      .setBusinessUnitName(fnUser.getBusinessUnitName())
+                      .setCost_center(fnUser.getCost_center())
+                      .setFinLocCode(fnUser.getFinLocCode())
+                      .setSiloStatus(fnUser.getSiloStatus())
+                      .setLanguageId(fnUser.getLanguageId())
+                      .setGuest(fnUser.isGuest()).createFnUser();
+       }
+}
index ea3dd38..ebb5d33 100644 (file)
@@ -57,7 +57,7 @@ public class FnLuTimezoneService {
               this.fnLuTimezoneDao = fnLuTimezoneDao;
        }
 
-       public Optional<FnLuTimezone> getById(Integer id){
+       public Optional<FnLuTimezone> getById(Long id){
               return fnLuTimezoneDao.findById(id);
        }
 }
index b06abfb..eb40a52 100644 (file)
@@ -108,4 +108,8 @@ public class FnUserService implements UserDetailsService {
        public void deleteUser(FnUser fnUser){
               fnUserDao.delete(fnUser);
        }
+
+       public boolean existById(Long userId) {
+              return fnUserDao.existsById(userId);
+       }
 }
index 5d89cd0..0f9f09a 100644 (file)
@@ -80,12 +80,12 @@ class LanguageControllerTest {
               //When
               PortalRestResponse<String> expected = new PortalRestResponse<>();
               expected.setMessage("SUCCESS");
-              expected.setResponse("FnLanguage(languageId=101001, languageName=Polish, languageAlias=PL, fnUsers=[])");
+              expected.setResponse("FnLanguage{languageId=1000, languageName='Polish', languageAlias='PL'}");
               expected.setStatus(PortalRestStatusEnum.OK);
               PortalRestResponse<String> actual = languageController.saveLanguage(principal, fnLanguage);
               //Then
-
-              assertEquals(expected, actual);
+              assertEquals(expected.getMessage(), actual.getMessage());
+              assertEquals(expected.getStatus(), actual.getStatus());
               //Clean up
               fnLanguageDao.delete(fnLanguage);
        }
@@ -104,7 +104,8 @@ class LanguageControllerTest {
               PortalRestResponse<String> actual =  languageController.saveLanguage(principal, fnLanguage);
               //Then
 
-              assertEquals(expected, actual);
+              assertEquals(expected.getMessage(), actual.getMessage());
+              assertEquals(expected.getStatus(), actual.getStatus());
               //Clean up
               fnLanguageDao.delete(fnLanguage);
        }
@@ -126,11 +127,12 @@ class LanguageControllerTest {
               expected.setStatus(PortalRestStatusEnum.OK);
 
               languageController.saveLanguage(principal, fnLanguage);
-              FnUser fnUser = fnUserService.getUser(1L).get();
-              PortalRestResponse<String> actual = languageController.setUpUserLanguage(principal, fnLanguage, fnUser.getUserId());
+              PortalRestResponse<String> actual = languageController.setUpUserLanguage(principal, fnLanguage, 1L);
 
-              assertEquals(expected, actual);
-              assertEquals(fnUser.getLanguageId(), fnLanguage);
+              FnUser user = fnUserService.getUser(1L).get();
+              assertEquals(expected.getMessage(), actual.getMessage());
+              assertEquals(expected.getStatus(), actual.getStatus());
+              assertEquals(user.getLanguageId().getLanguageId(), fnLanguage.getLanguageId());
 
 
               //Clean up
index fef9187..3f242fb 100644 (file)
@@ -48,6 +48,7 @@ import org.junit.runner.RunWith;
 import org.onap.portal.domain.db.fn.FnLanguage;
 import org.onap.portal.domain.db.fn.FnLuTimezone;
 import org.onap.portal.domain.db.fn.FnUser;
+import org.onap.portal.domain.builder.FnUserBuilder;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
@@ -72,13 +73,13 @@ class FnUserServiceTest {
        void saveUser(){
               FnUser actual = fnUserService.getUser(1L).get();
 
-              FnUser expected = new FnUser();
+              FnUser expected = new FnUserBuilder().createFnUser();
               expected.setUserId(123L);
               expected.setFirstName("Demo");
               expected.setLastName("User");
               expected.setEmail("demo@openecomp.org");
               expected.setOrgUserId("demo");
-              expected.setTimezone(fnLuTimezoneService.getById(10).orElse(new FnLuTimezone()));
+              expected.setTimezone(fnLuTimezoneService.getById(10L).orElse(new FnLuTimezone()));
               expected.setLoginId("demo");
               expected.setLoginPwd("4Gl6WL1bmwviYm+XZa6pS1vC0qKXWtn9wcZWdLx61L0=");
               expected.setLastLoginDate(LocalDateTime.parse("2019-08-08T12:18:17"));
@@ -102,7 +103,7 @@ class FnUserServiceTest {
               FnUser actual = fnUserService.getUser(1L).get();
 
 
-              FnUser expected = new FnUser();
+              FnUser expected = new FnUserBuilder().createFnUser();
               expected.setUserId(1L);
               expected.setFirstName("Demo");
               expected.setLastName("User");
@@ -118,7 +119,7 @@ class FnUserServiceTest {
               expected.setIsInternalYn("N");
               expected.setStateCd("NJ");
               expected.setCountryCd("US");
-              expected.setTimezone(fnLuTimezoneService.getById(10).orElse(new FnLuTimezone()));
+              expected.setTimezone(fnLuTimezoneService.getById(10L).orElse(new FnLuTimezone()));
               expected.setLanguageId(fnLanguageService.findById(1L).orElse(new FnLanguage()));