Domain model change
[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.SequenceGenerator;
50 import javax.persistence.Table;
51 import javax.persistence.UniqueConstraint;
52 import javax.validation.constraints.Digits;
53 import javax.validation.constraints.NotNull;
54 import javax.validation.constraints.Size;
55 import lombok.AllArgsConstructor;
56 import lombok.Getter;
57 import lombok.NoArgsConstructor;
58 import lombok.Setter;
59 import org.hibernate.validator.constraints.SafeHtml;
60 /*
61 CREATE TABLE `fn_workflow` (
62         `id` mediumint(9) NOT NULL AUTO_INCREMENT,
63         `name` varchar(20) NOT NULL,
64         `description` varchar(500) DEFAULT NULL,
65         `run_link` varchar(300) DEFAULT NULL,
66         `suspend_link` varchar(300) DEFAULT NULL,
67         `modified_link` varchar(300) DEFAULT NULL,
68         `active_yn` varchar(300) DEFAULT NULL,
69         `created` varchar(300) DEFAULT NULL,
70         `created_by` int(11) DEFAULT NULL,
71         `modified` varchar(300) DEFAULT NULL,
72         `modified_by` int(11) DEFAULT NULL,
73         `workflow_key` varchar(50) DEFAULT NULL,
74         PRIMARY KEY (`id`),
75         UNIQUE KEY `name` (`name`)
76         )
77 */
78
79 @Table(name = "fn_workflow", uniqueConstraints = {
80         @UniqueConstraint(name = "name", columnNames = "name")
81 })
82 @NoArgsConstructor
83 @AllArgsConstructor
84 @Getter
85 @Setter
86 @Entity
87 public class FnWorkflow implements Serializable {
88        @Id
89
90   @GeneratedValue(strategy = GenerationType.AUTO)
91        @Column(name = "id", nullable = false, length = 9, columnDefinition = "mediumint(9) AUTO_INCREMENT")
92        @Digits(integer = 9, fraction = 0)
93        private Integer id;
94        @Column(name = "name", length = 20, nullable = false, unique = true)
95        @Size(max = 20)
96        @SafeHtml
97        @NotNull
98        private String name;
99        @Column(name = "description", length = 500, columnDefinition = "varchar(500) default null")
100        @Size(max = 500)
101        @SafeHtml
102        private String description;
103        @Column(name = "run_link", length = 300, columnDefinition = "varchar(300) default null")
104        @Size(max = 300)
105        @SafeHtml
106        private String runLink;
107        @Column(name = "suspend_link", length = 300, columnDefinition = "varchar(300) default null")
108        @Size(max = 300)
109        @SafeHtml
110        private String suspendLink;
111        @Column(name = "modified_link", length = 300, columnDefinition = "varchar(300) default null")
112        @Size(max = 300)
113        @SafeHtml
114        private String modifiedLink;
115        //TODO varchar(300)? Should be varchar(1)?
116        @Column(name = "active_yn", length = 300, columnDefinition = "varchar(300) default null")
117        @Size(max = 300)
118        @SafeHtml
119        private String activeYn;
120        @Column(name = "created", length = 300, columnDefinition = "varchar(300) default null")
121        @Size(max = 300)
122        @SafeHtml
123        private String created;
124        @Column(name = "created_by", length = 11, columnDefinition = "int(11) default null")
125        @Digits(integer = 11, fraction = 0)
126        private Integer created_by;
127        @Column(name = "modified", length = 300, columnDefinition = "varchar(300) default null")
128        @Size(max = 300)
129        @SafeHtml
130        private String modified;
131        @Column(name = "modified_by", length = 11, columnDefinition = "int(11) default null")
132        @Digits(integer = 11, fraction = 0)
133        private Integer modified_by;
134        @Column(name = "workflow_key", length = 50, columnDefinition = "varchar(50) default null")
135        @Size(max = 50)
136        @SafeHtml
137        private String workflowKey;
138
139 }