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;
45 import javax.persistence.CascadeType;
46 import javax.persistence.Column;
47 import javax.persistence.Entity;
48 import javax.persistence.FetchType;
49 import javax.persistence.GeneratedValue;
50 import javax.persistence.GenerationType;
51 import javax.persistence.Id;
52 import javax.persistence.Index;
53 import javax.persistence.JoinColumn;
54 import javax.persistence.JoinTable;
55 import javax.persistence.ManyToMany;
56 import javax.persistence.ManyToOne;
57 import javax.persistence.NamedQueries;
58 import javax.persistence.NamedQuery;
59 import javax.persistence.OneToMany;
60 import javax.persistence.SequenceGenerator;
61 import javax.persistence.Table;
62 import javax.validation.Valid;
63 import javax.validation.constraints.Digits;
64 import javax.validation.constraints.NotNull;
65 import javax.validation.constraints.Pattern;
66 import javax.validation.constraints.Size;
67 import lombok.AllArgsConstructor;
68 import lombok.Builder;
70 import lombok.NoArgsConstructor;
72 import org.hibernate.validator.constraints.SafeHtml;
73 import org.hibernate.validator.constraints.URL;
76 CREATE TABLE `fn_menu_functional` (
77 `menu_id` int(11) NOT NULL AUTO_INCREMENT,
78 `column_num` int(2) NOT NULL,
79 `text` varchar(100) NOT NULL,
80 `parent_menu_id` int(11) DEFAULT NULL,
81 `url` varchar(128) NOT NULL DEFAULT '',
82 `active_yn` varchar(1) NOT NULL DEFAULT 'y',
83 `image_src` varchar(100) DEFAULT NULL,
84 PRIMARY KEY (`menu_id`),
85 KEY `fk_fn_menu_func_parent_menu_id_idx` (`parent_menu_id`),
86 CONSTRAINT `fk_fn_menu_func_parent_menu_id` FOREIGN KEY (`parent_menu_id`) REFERENCES `fn_menu_functional` (`menu_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
92 name = "FnMenuFunctional.retrieveByMenuId",
93 query = "from FnMenuFunctionalRoles where menuId =:menuId"
98 @Table(name = "fn_menu_functional", indexes = {@Index(columnList = "parent_menu_id", name = "fk_fn_menu_func_parent_menu_id_idx")
106 public class FnMenuFunctional implements Serializable {
108 @GeneratedValue(strategy = GenerationType.AUTO)
109 @Column(name = "menu_id", nullable = false, length = 11)
110 @Digits(integer = 11, fraction = 0)
112 @Column(name = "column_num", nullable = false, length = 2)
113 @Digits(integer = 2, fraction = 0)
114 private Long columnNum;
115 @Column(name = "text", length = 100, nullable = false)
120 @ManyToOne(cascade = CascadeType.MERGE, fetch = FetchType.LAZY)
121 @JoinColumn(name = "parent_menu_id")
123 private FnMenuFunctional parentMenuId;
124 @Column(name = "url", length = 128, nullable = false, columnDefinition = "varchar(128) default ''")
131 @Column(name = "active_yn", length = 1, columnDefinition = "boolean default true", nullable = false)
133 private Boolean activeYn = true;
134 @Column(name = "image_src", length = 100, columnDefinition = "varchar(100) default null")
137 private String imageSrc;
138 @ManyToMany(cascade = CascadeType.MERGE, fetch = FetchType.LAZY)
140 name = "fn_menu_favorites",
141 joinColumns = {@JoinColumn(name = "menu_id", referencedColumnName = "menu_id")},
142 inverseJoinColumns = {@JoinColumn(name = "role_Id", referencedColumnName = "id", columnDefinition = "bigint")},
144 @Index(name = "sys_c0014619", columnList = "menu_id")
147 private Set<FnUser> fnUsers;
149 targetEntity = FnMenuFunctionalAncestors.class,
151 cascade = CascadeType.MERGE,
152 fetch = FetchType.LAZY
154 private Set<FnMenuFunctionalAncestors> fnMenuFunctionalAncestorsMenuId;
156 targetEntity = FnMenuFunctionalAncestors.class,
157 mappedBy = "ancestorMenuId",
158 cascade = CascadeType.MERGE,
159 fetch = FetchType.LAZY
161 private Set<FnMenuFunctionalAncestors> fnMenuFunctionalsAncestorMenuId;
163 targetEntity = FnMenuFunctionalRoles.class,
165 cascade = CascadeType.MERGE,
166 fetch = FetchType.LAZY
168 private Set<FnMenuFunctionalRoles> fnMenuFunctionalRoles;