diff options
author | 2019-08-16 13:14:21 +0200 | |
---|---|---|
committer | 2019-08-16 13:58:00 +0200 | |
commit | 94b811152499b336fb7616bd0d39a952dc59abe9 (patch) | |
tree | 331f373722b08d86674269fd163c99e67833ba6c /portal-BE/src/main/java/org | |
parent | c2dfca4b1ca4cecd7595b4a5618d89fd44093a13 (diff) |
Portal Spring Boot version Hibernate implementation
Create classes that represent tables in the original database.
Issue-ID: PORTAL-705
Change-Id: I298051ad4c61c31e2018b23ffee77ed0c59cbdd8
Signed-off-by: Dominik Mizyn <d.mizyn@samsung.com>
Diffstat (limited to 'portal-BE/src/main/java/org')
-rw-r--r-- | portal-BE/src/main/java/org/onap/portal/domain/db/SchemaInfo.java | 120 |
1 files changed, 120 insertions, 0 deletions
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/SchemaInfo.java b/portal-BE/src/main/java/org/onap/portal/domain/db/SchemaInfo.java new file mode 100644 index 00000000..dee9aa5f --- /dev/null +++ b/portal-BE/src/main/java/org/onap/portal/domain/db/SchemaInfo.java @@ -0,0 +1,120 @@ +/* + * ============LICENSE_START========================================== + * ONAP Portal + * =================================================================== + * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * =================================================================== + * Modifications Copyright (c) 2019 Samsung + * =================================================================== + * + * Unless otherwise specified, all software contained herein is licensed + * under the Apache License, Version 2.0 (the "License"); + * you may not use this software except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * ============LICENSE_END============================================ + * + * + */ + +package org.onap.portal.domain.db; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import org.hibernate.validator.constraints.SafeHtml; + +/* +CREATE TABLE `schema_info` ( + `SCHEMA_ID` varchar(25) NOT NULL, + `SCHEMA_DESC` varchar(75) NOT NULL, + `DATASOURCE_TYPE` varchar(100) DEFAULT NULL, + `CONNECTION_URL` varchar(200) NOT NULL, + `USER_NAME` varchar(45) NOT NULL, + `PASSWORD` varchar(45) DEFAULT NULL, + `DRIVER_CLASS` varchar(100) NOT NULL, + `MIN_POOL_SIZE` int(11) NOT NULL, + `MAX_POOL_SIZE` int(11) NOT NULL, + `IDLE_CONNECTION_TEST_PERIOD` int(11) NOT NULL + ) +*/ + +@Table(name = "schema_info") +@NoArgsConstructor +@AllArgsConstructor +@Getter +@Setter +@Entity +public class SchemaInfo { + @Id + @Column(name = "SCHEMA_ID", length = 25, nullable = false) + @Size(max = 25) + @SafeHtml + private String schemaId; + @Column(name = "SCHEMA_DESC", length = 75, nullable = false) + @Size(max = 75) + @SafeHtml + @NotNull + private String schemaDesc; + @Column(name = "DATASOURCE_TYPE", length = 100, columnDefinition = "varchar(100) DEFAULT NULL") + @Size(max = 100) + @SafeHtml + private String datasourceType; + @Column(name = "CONNECTION_URL", length = 200, nullable = false) + @Size(max = 200) + @SafeHtml + @NotNull + private String connectionUrl; + @Column(name = "USER_NAME", length = 45, nullable = false) + @Size(max = 45) + @SafeHtml + @NotNull + private String userName; + @Column(name = "PASSWORD", length = 45, columnDefinition = "varchar(45) default null") + @Size(max = 45) + @SafeHtml + private String password; + @Column(name = "DRIVER_CLASS", length = 100, nullable = false) + @Size(max = 100) + @SafeHtml + @NotNull + private String driverClass; + @Column(name = "MIN_POOL_SIZE", nullable = false) + @NotNull + private Long minPoolSize; + @Column(name = "MAX_POOL_SIZE", nullable = false) + @NotNull + private Long maxPoolSize; + @Column(name = "IDLE_CONNECTION_TEST_PERIOD", nullable = false) + @NotNull + private Long idleConnectionTestPeriod; + +} |