summaryrefslogtreecommitdiffstats
path: root/portal-BE/src/main
diff options
context:
space:
mode:
authorDominik Mizyn <d.mizyn@samsung.com>2019-09-02 13:37:43 +0200
committerDominik Mizyn <d.mizyn@samsung.com>2019-09-10 11:35:29 +0200
commitf51a049146c96181b43ca3f72c1cf715f07d24a9 (patch)
treef1462f34f0dc0d793ddc6faa7e3ab9d3d49fd675 /portal-BE/src/main
parent0dd6f1189815079526c3f5211f01650bbe5e665b (diff)
Docker-compose up
Docker-compose for Portal-APP and MaridDB Signed-off-by: Dominik Mizyn <d.mizyn@samsung.com> Change-Id: I5031c524ef109da044f484555fb1319f2ad7092f Issue-ID: PORTAL-710 Signed-off-by: Dominik Mizyn <d.mizyn@samsung.com>
Diffstat (limited to 'portal-BE/src/main')
-rw-r--r--portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnOrg.java3
-rw-r--r--portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnUser.java68
-rw-r--r--portal-BE/src/main/java/org/onap/portal/domain/dto/DomainVo.java6
-rw-r--r--portal-BE/src/main/resources/application.properties13
4 files changed, 47 insertions, 43 deletions
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnOrg.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnOrg.java
index 310c3619..9dea65ed 100644
--- a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnOrg.java
+++ b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnOrg.java
@@ -76,7 +76,6 @@ CREATE TABLE `fn_org` (
})
@NoArgsConstructor
@AllArgsConstructor
-
@Getter
@Setter
@Entity
@@ -91,7 +90,7 @@ public class FnOrg implements Serializable {
@SafeHtml
@NotNull
private String orgName;
- @Column(name = "access_cd", length = 10, columnDefinition = "varchar(10) DEFAULT NULL")
+ @Column(name = "access_cd", length = 10)
@Size(max = 10)
@SafeHtml
private String accessCd;
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnUser.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnUser.java
index 029420d3..afd70b03 100644
--- a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnUser.java
+++ b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnUser.java
@@ -190,70 +190,70 @@ public class FnUser extends DomainVo implements UserDetails, Serializable {
@Digits(integer = 11, fraction = 0)
private Long userId;
@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
- @JoinColumn(name = "org_id", columnDefinition = "int(11) DEFAULT NULL")
+ @JoinColumn(name = "org_id")
private FnOrg orgId;
@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinColumn(name = "manager_id")
private FnUser managerId;
- @Column(name = "first_name", length = 50, columnDefinition = "varchar(50) DEFAULT NULL")
+ @Column(name = "first_name", length = 50)
@Size(max = 50)
@SafeHtml
private String firstName;
- @Column(name = "middle_name", length = 50, columnDefinition = "varchar(50) DEFAULT NULL")
+ @Column(name = "middle_name", length = 50)
@Size(max = 50)
@SafeHtml
private String middleName;
- @Column(name = "last_name", length = 50, columnDefinition = "varchar(50) DEFAULT NULL")
+ @Column(name = "last_name", length = 50)
@Size(max = 50)
@SafeHtml
private String lastName;
- @Column(name = "phone", length = 25, columnDefinition = "varchar(25) DEFAULT NULL")
+ @Column(name = "phone", length = 25)
@Size(max = 25)
@SafeHtml
private String phone;
- @Column(name = "fax", length = 25, columnDefinition = "varchar(25) DEFAULT NULL")
+ @Column(name = "fax", length = 25)
@Size(max = 25)
@SafeHtml
private String fax;
- @Column(name = "cellular", length = 25, columnDefinition = "varchar(25) DEFAULT NULL")
+ @Column(name = "cellular", length = 25)
@Size(max = 25)
@SafeHtml
private String cellular;
- @Column(name = "email", length = 50, columnDefinition = "varchar(50) DEFAULT NULL")
+ @Column(name = "email", length = 50)
@Size(max = 50)
@Email
@SafeHtml
private String email;
- @Column(name = "address_id", columnDefinition = "decimal(11,0) DEFAULT NULL")
+ @Column(name = "address_id")
@Digits(integer = 11, fraction = 0)
private Long addressId;
@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
- @JoinColumn(name = "alert_method_cd", columnDefinition = "varchar(10) DEFAULT NULL")
+ @JoinColumn(name = "alert_method_cd")
private FnLuAlertMethod alertMethodCd;
- @Column(name = "hrid", length = 20, columnDefinition = "varchar(20) DEFAULT NULL")
+ @Column(name = "hrid", length = 20)
@Size(max = 20)
@SafeHtml
private String hrid;
- @Column(name = "org_user_id", length = 20, columnDefinition = "varchar(20) DEFAULT NULL")
+ @Column(name = "org_user_id", length = 20)
@Size(max = 20)
@SafeHtml
private String orgUserId;
- @Column(name = "org_code", length = 30, columnDefinition = "varchar(30) DEFAULT NULL")
+ @Column(name = "org_code", length = 30)
@Size(max = 30)
@SafeHtml
private String org_code;
- @Column(name = "login_id", length = 25, columnDefinition = "varchar(25) DEFAULT NULL")
+ @Column(name = "login_id", length = 25)
@Size(max = 25)
@SafeHtml
private String loginId;
- @Column(name = "login_pwd", length = 100, columnDefinition = "varchar(100) DEFAULT NULL")
+ @Column(name = "login_pwd", length = 100)
@Size(max = 100)
@SafeHtml
private String loginPwd;
@Column(name = "last_login_date", nullable = false, columnDefinition = "datetime DEFAULT current_timestamp() ON UPDATE current_timestamp()")
@PastOrPresent
protected LocalDateTime lastLoginDate;
- @Column(name = "active_yn", length = 1, columnDefinition = "character varying(1) default 'y'", nullable = false)
+ @Column(name = "active_yn", length = 1, nullable = false)
@Size(max = 1)
@SafeHtml
@NotNull(message = "activeYn must not be null")
@@ -275,74 +275,74 @@ public class FnUser extends DomainVo implements UserDetails, Serializable {
@SafeHtml
@NotNull(message = "isInternalYn must not be null")
private String isInternalYn;
- @Column(name = "address_line_1", length = 100, columnDefinition = "varchar(100) DEFAULT NULL")
+ @Column(name = "address_line_1", length = 100)
@Size(max = 100)
@SafeHtml
private String addressLine1;
- @Column(name = "address_line_2", length = 100, columnDefinition = "varchar(100) DEFAULT NULL")
+ @Column(name = "address_line_2", length = 100)
@Size(max = 100)
@SafeHtml
private String addressLine2;
- @Column(name = "city", length = 50, columnDefinition = "varchar(50) DEFAULT NULL")
+ @Column(name = "city", length = 50)
@Size(max = 50)
@SafeHtml
private String city;
- @Column(name = "state_cd", length = 3, columnDefinition = "varchar(3) DEFAULT NULL")
+ @Column(name = "state_cd", length = 3)
@Size(max = 3)
@SafeHtml
private String stateCd;
- @Column(name = "zip_code", length = 11, columnDefinition = "varchar(11) DEFAULT NULL")
+ @Column(name = "zip_code", length = 11)
@Size(max = 11)
@SafeHtml
private String zipCode;
- @Column(name = "country_cd", length = 3, columnDefinition = "varchar(3) DEFAULT NULL")
+ @Column(name = "country_cd", length = 3)
@Size(max = 3)
@SafeHtml
private String countryCd;
- @Column(name = "location_clli", length = 8, columnDefinition = "varchar(8) DEFAULT NULL")
+ @Column(name = "location_clli", length = 8)
@Size(max = 8)
@SafeHtml
private String locationClli;
- @Column(name = "org_manager_userid", length = 20, columnDefinition = "varchar(20) DEFAULT NULL")
+ @Column(name = "org_manager_userid", length = 20)
@Size(max = 20)
@SafeHtml
private String orgManagerUserId;
- @Column(name = "company", length = 100, columnDefinition = "varchar(100) DEFAULT NULL")
+ @Column(name = "company", length = 100)
@Size(max = 100)
@SafeHtml
private String company;
- @Column(name = "department_name", length = 200, columnDefinition = "varchar(100) DEFAULT NULL")
+ @Column(name = "department_name", length = 200)
@Size(max = 200)
@SafeHtml
private String departmentName;
- @Column(name = "job_title", length = 100, columnDefinition = "varchar(100) DEFAULT NULL")
+ @Column(name = "job_title", length = 100)
@Size(max = 100)
@SafeHtml
private String jobTitle;
@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
- @JoinColumn(name = "timezone", columnDefinition = "int(11) DEFAULT NULL")
+ @JoinColumn(name = "timezone")
private FnLuTimezone timezone;
- @Column(name = "department", length = 25, columnDefinition = "varchar(25) DEFAULT NULL")
+ @Column(name = "department", length = 25)
@Size(max = 25)
@SafeHtml
private String department;
- @Column(name = "business_unit", length = 25, columnDefinition = "varchar(25) DEFAULT NULL")
+ @Column(name = "business_unit", length = 25)
@Size(max = 25)
@SafeHtml
private String businessUnit;
- @Column(name = "business_unit_name", length = 100, columnDefinition = "varchar(100) DEFAULT NULL")
+ @Column(name = "business_unit_name", length = 100)
@Size(max = 100)
@SafeHtml
private String businessUnitName;
- @Column(name = "cost_center", length = 25, columnDefinition = "varchar(25) DEFAULT NULL")
+ @Column(name = "cost_center", length = 25)
@Size(max = 25)
@SafeHtml
private String cost_center;
- @Column(name = "fin_loc_code", length = 10, columnDefinition = "varchar(10) DEFAULT NULL")
+ @Column(name = "fin_loc_code", length = 10)
@Size(max = 10)
@SafeHtml
private String finLocCode;
- @Column(name = "silo_status", length = 10, columnDefinition = "varchar(10) DEFAULT NULL")
+ @Column(name = "silo_status", length = 10)
@Size(max = 10)
@SafeHtml
private String siloStatus;
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/dto/DomainVo.java b/portal-BE/src/main/java/org/onap/portal/domain/dto/DomainVo.java
index 98a0d05b..6901aeef 100644
--- a/portal-BE/src/main/java/org/onap/portal/domain/dto/DomainVo.java
+++ b/portal-BE/src/main/java/org/onap/portal/domain/dto/DomainVo.java
@@ -45,7 +45,7 @@ import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
-import java.util.Date;
+import java.time.LocalDateTime;
import java.util.Set;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
@@ -66,8 +66,8 @@ public class DomainVo extends FusionVo implements Serializable, Cloneable, Compa
private static final long serialVersionUID = 1L;
protected Long id;
- protected Date created;
- protected Date modified;
+ protected LocalDateTime created;
+ protected LocalDateTime modified;
protected FnUser createdId;
protected FnUser modifiedId;
protected Long rowNum;
diff --git a/portal-BE/src/main/resources/application.properties b/portal-BE/src/main/resources/application.properties
index e31dcc30..30c0beeb 100644
--- a/portal-BE/src/main/resources/application.properties
+++ b/portal-BE/src/main/resources/application.properties
@@ -1,16 +1,21 @@
server.port=8080
-spring.datasource.url=jdbc:mysql://localhost:3306/testdb?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
+spring.datasource.url=jdbc:mysql://portal-db:3306/testdb?createDatabaseIfNotExist=true&useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
spring.datasource.initialization-mode=always
spring.session.jdbc.initialize-schema=always
spring.datasource.continueOnError=true
-spring.datasource.username=root
-spring.datasource.password=root
+spring.datasource.username=portal
+spring.datasource.password=Test123456
+log4j.logger.org.hibernate=info
+
+#H2 config
+spring.h2.console.settings.web-allow-others=true
+spring.h2.console.enabled=true
spring.jpa.database-platform=org.hibernate.dialect.MariaDBDialect
spring.jpa.hibernate.ddl-auto=update
spring.jpa.database=mysql
spring.jpa.show-sql=true
-spring.jooq.sql-dialect=MARIADB
+spring.jooq.sql-dialect=MARIADB \ No newline at end of file