2 * ================================================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ================================================================================
20 package org.openecomp.portalapp.portal.domain;
22 import java.util.List;
24 import javax.persistence.Column;
25 import javax.persistence.Entity;
26 import javax.persistence.GeneratedValue;
27 import javax.persistence.GenerationType;
28 import javax.persistence.Id;
29 import javax.persistence.Transient;
32 * This class is almost identical to org.openecomp.portalapp.portal.transport.FunctionalMenuItem
33 * The only difference is the appId field. In FunctionMenuItem, we used @Transient as an attribute, and we are using @Column in this class.
34 * In some sql queries, we need to have appId, but it's not a field in fn_menu_functional table.
40 public class FunctionalMenuItemWithAppID{
41 private static final long serialVersionUID = 1L;
44 @GeneratedValue(strategy=GenerationType.IDENTITY)
45 @Column(name = "MENU_ID")
48 @Column(name = "COLUMN_NUM")
49 public Integer column;
51 @Column(name = "TEXT")
54 @Column(name = "PARENT_MENU_ID")
55 public Integer parentMenuId;
60 @Column(name="ACTIVE_YN")
61 public String active_yn;
63 @Column(name="APP_ID")
67 public List<Integer> roles;
70 public Boolean restrictedApp;
72 public void normalize() {
73 if (this.column == null)
74 this.column = new Integer(1);
75 this.text = (this.text == null) ? "" : this.text.trim();
76 if (this.parentMenuId == null)
77 this.parentMenuId = new Integer(-1);
78 this.url = (this.url == null) ? "" : this.url.trim();
82 public String toString() {
83 return "FunctionalMenuItem [menuId=" + menuId + ", column=" + column + ", text=" + text + ", parentMenuId="
84 + parentMenuId + ", url=" + url + ", active_yn=" + active_yn + ", appid=" + appid + ", roles=" + roles
85 + ", restrictedApp=" + restrictedApp + "]";
88 public void setUrl(String url) {
92 public void setRestrictedApp(Boolean restrictedApp) {
93 this.restrictedApp = restrictedApp;