2 * ============LICENSE_START==========================================
4 * ===================================================================
5 * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
6 * ===================================================================
7 * Modifications Copyright (c) 2019 Samsung
8 * ===================================================================
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
15 * http://www.apache.org/licenses/LICENSE-2.0
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.
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
28 * https://creativecommons.org/licenses/by/4.0/
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.
36 * ============LICENSE_END============================================
41 package org.onap.portal.domain.db.fn;
43 import java.io.Serializable;
44 import java.math.BigInteger;
46 import javax.persistence.CascadeType;
47 import javax.persistence.Column;
48 import javax.persistence.Entity;
49 import javax.persistence.FetchType;
50 import javax.persistence.Id;
51 import javax.persistence.Index;
52 import javax.persistence.JoinColumn;
53 import javax.persistence.ManyToOne;
54 import javax.persistence.OneToMany;
55 import javax.persistence.Table;
56 import javax.validation.Valid;
57 import javax.validation.constraints.Digits;
58 import javax.validation.constraints.NotNull;
59 import javax.validation.constraints.Pattern;
60 import javax.validation.constraints.Size;
61 import lombok.AllArgsConstructor;
62 import lombok.Builder;
64 import lombok.NoArgsConstructor;
66 import org.hibernate.validator.constraints.SafeHtml;
69 CREATE TABLE `fn_tab` (
70 `tab_cd` varchar(30) NOT NULL,
71 `tab_name` varchar(50) NOT NULL,
72 `tab_descr` varchar(100) DEFAULT NULL,
73 `action` varchar(100) NOT NULL,
74 `function_cd` varchar(30) NOT NULL,
75 `active_yn` char(1) NOT NULL,
76 `sort_order` decimal(11,0) NOT NULL,
77 `parent_tab_cd` varchar(30) DEFAULT NULL,
78 `tab_set_cd` varchar(30) DEFAULT NULL,
79 PRIMARY KEY (`tab_cd`),
80 KEY `fk_fn_tab_function_cd` (`function_cd`),
81 KEY `fk_fn_tab_set_cd` (`tab_set_cd`),
82 CONSTRAINT `fk_fn_tab_function_cd` FOREIGN KEY (`function_cd`) REFERENCES `fn_function` (`function_cd`),
83 CONSTRAINT `fk_fn_tab_set_cd` FOREIGN KEY (`tab_set_cd`) REFERENCES `fn_lu_tab_set` (`tab_set_cd`)
87 @Table(name = "fn_tab", indexes = {
88 @Index(name = "fk_fn_tab_function_cd", columnList = "function_cd"),
89 @Index(name = "fk_fn_tab_set_cd", columnList = "tab_set_cd")
97 public class FnTab implements Serializable {
99 @Column(name = "tab_cd", length = 30, nullable = false)
102 private String tabCd;
103 @Column(name = "tab_name", length = 50, nullable = false)
107 private String tabName;
108 @Column(name = "tab_descr", length = 100, columnDefinition = "varchar(100) DEFAULT NULL")
111 private String tabDescr;
112 @Column(name = "action", length = 100, nullable = false)
116 private String action;
117 @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.MERGE)
118 @JoinColumn(name = "function_cd", nullable = false)
121 private FnFunction functionCd;
122 @Column(name = "active_yn", nullable = false)
124 private Boolean activeYn;
125 @Column(name = "sort_order", length = 11, nullable = false)
126 @Digits(integer = 11, fraction = 0)
128 private Long sortDrder;
129 @Column(name = "parent_tab_cd", length = 30, columnDefinition = "varchar(30) DEFAULT NULL")
132 private String parentTabCd;
133 @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.MERGE)
134 @JoinColumn(name = "tab_set_cd", nullable = false)
137 private FnLuTabSet tabSetCd;
139 targetEntity = FnTabSelected.class,
140 mappedBy = "selectedTabCd",
141 cascade = CascadeType.MERGE,
142 fetch = FetchType.LAZY
144 private Set<FnTabSelected> selectedTabCd;