Coverity Scan issues fix
[portal.git] / portal-BE / src / main / java / org / onap / portal / domain / db / fn / FnWorkflow.java
1 /*
2  * ============LICENSE_START==========================================
3  * ONAP Portal
4  * ===================================================================
5  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
6  * ===================================================================
7  * Modifications Copyright (c) 2019 Samsung
8  * ===================================================================
9  *
10  * Unless otherwise specified, all software contained herein is licensed
11  * under the Apache License, Version 2.0 (the "License");
12  * you may not use this software except in compliance with the License.
13  * You may obtain a copy of the License at
14  *
15  *             http://www.apache.org/licenses/LICENSE-2.0
16  *
17  * Unless required by applicable law or agreed to in writing, software
18  * distributed under the License is distributed on an "AS IS" BASIS,
19  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  * See the License for the specific language governing permissions and
21  * limitations under the License.
22  *
23  * Unless otherwise specified, all documentation contained herein is licensed
24  * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
25  * you may not use this documentation except in compliance with the License.
26  * You may obtain a copy of the License at
27  *
28  *             https://creativecommons.org/licenses/by/4.0/
29  *
30  * Unless required by applicable law or agreed to in writing, documentation
31  * distributed under the License is distributed on an "AS IS" BASIS,
32  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
33  * See the License for the specific language governing permissions and
34  * limitations under the License.
35  *
36  * ============LICENSE_END============================================
37  *
38  *
39  */
40
41 package org.onap.portal.domain.db.fn;
42
43 import java.io.Serializable;
44 import javax.persistence.Column;
45 import javax.persistence.Entity;
46 import javax.persistence.GeneratedValue;
47 import javax.persistence.GenerationType;
48 import javax.persistence.Id;
49 import javax.persistence.Table;
50 import javax.persistence.UniqueConstraint;
51 import javax.validation.constraints.Digits;
52 import javax.validation.constraints.NotNull;
53 import javax.validation.constraints.Size;
54 import lombok.AllArgsConstructor;
55 import lombok.Getter;
56 import lombok.NoArgsConstructor;
57 import lombok.Setter;
58 import org.hibernate.validator.constraints.SafeHtml;
59 /*
60 CREATE TABLE `fn_workflow` (
61         `id` mediumint(9) NOT NULL AUTO_INCREMENT,
62         `name` varchar(20) NOT NULL,
63         `description` varchar(500) DEFAULT NULL,
64         `run_link` varchar(300) DEFAULT NULL,
65         `suspend_link` varchar(300) DEFAULT NULL,
66         `modified_link` varchar(300) DEFAULT NULL,
67         `active_yn` varchar(300) DEFAULT NULL,
68         `created` varchar(300) DEFAULT NULL,
69         `created_by` int(11) DEFAULT NULL,
70         `modified` varchar(300) DEFAULT NULL,
71         `modified_by` int(11) DEFAULT NULL,
72         `workflow_key` varchar(50) DEFAULT NULL,
73         PRIMARY KEY (`id`),
74         UNIQUE KEY `name` (`name`)
75         )
76 */
77
78 @Table(name = "fn_workflow", uniqueConstraints = {
79         @UniqueConstraint(name = "name", columnNames = "name")
80 })
81 @NoArgsConstructor
82 @AllArgsConstructor
83 @Getter
84 @Setter
85 @Entity
86 public class FnWorkflow implements Serializable {
87        @Id
88        @GeneratedValue(strategy = GenerationType.AUTO)
89        @Column(name = "id", nullable = false, length = 9, columnDefinition = "mediumint(9) AUTO_INCREMENT")
90        @Digits(integer = 9, fraction = 0)
91        private Integer id;
92        @Column(name = "name", length = 20, nullable = false, unique = true)
93        @Size(max = 20)
94        @SafeHtml
95        @NotNull
96        private String name;
97        @Column(name = "description", length = 500, columnDefinition = "varchar(500) default null")
98        @Size(max = 500)
99        @SafeHtml
100        private String description;
101        @Column(name = "run_link", length = 300, columnDefinition = "varchar(300) default null")
102        @Size(max = 300)
103        @SafeHtml
104        private String runLink;
105        @Column(name = "suspend_link", length = 300, columnDefinition = "varchar(300) default null")
106        @Size(max = 300)
107        @SafeHtml
108        private String suspendLink;
109        @Column(name = "modified_link", length = 300, columnDefinition = "varchar(300) default null")
110        @Size(max = 300)
111        @SafeHtml
112        private String modifiedLink;
113        //TODO varchar(300)? Should be varchar(1)?
114        @Column(name = "active_yn", length = 300, columnDefinition = "varchar(300) default null")
115        @Size(max = 300)
116        @SafeHtml
117        private String activeYn;
118        @Column(name = "created", length = 300, columnDefinition = "varchar(300) default null")
119        @Size(max = 300)
120        @SafeHtml
121        private String created;
122        @Column(name = "created_by", length = 11, columnDefinition = "int(11) default null")
123        @Digits(integer = 11, fraction = 0)
124        private Integer created_by;
125        @Column(name = "modified", length = 300, columnDefinition = "varchar(300) default null")
126        @Size(max = 300)
127        @SafeHtml
128        private String modified;
129        @Column(name = "modified_by", length = 11, columnDefinition = "int(11) default null")
130        @Digits(integer = 11, fraction = 0)
131        private Integer modified_by;
132        @Column(name = "workflow_key", length = 50, columnDefinition = "varchar(50) default null")
133        @Size(max = 50)
134        @SafeHtml
135        private String workflowKey;
136
137 }