Fixed health check issue
[portal.git] / portal-BE / src / main / java / org / onap / portal / domain / dto / transport / GlobalRoleWithApplicationRoleFunction.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.dto.transport;
42
43 import java.io.Serializable;
44 import javax.persistence.ColumnResult;
45 import javax.persistence.ConstructorResult;
46 import javax.persistence.NamedNativeQuery;
47 import javax.persistence.SqlResultSetMapping;
48 import lombok.AllArgsConstructor;
49 import lombok.Builder;
50 import lombok.Getter;
51 import lombok.NoArgsConstructor;
52 import lombok.Setter;
53 import lombok.ToString;
54
55 @NamedNativeQuery(
56     name = "GlobalRoleWithApplicationRoleFunction.getGlobalRoleForRequestedApp",
57     query = "select distinct "
58           + "    d.role_id as roleId, "
59           + "    d.role_name as roleName, "
60           + "    d.active_yn as active, "
61           + "    d.priority as priority, "
62           + "    c.function_cd as functionCd, "
63           + "    e.function_name as functionName, "
64           + "    c.app_id as appId, "
65           + "    c.role_app_id as roleAppId"
66           + "from fn_user_role a, fn_app b, ep_app_role_function c, fn_role d, ep_app_function e"
67           + "    where b.app_id = c.app_id"
68           + "    and a.app_id = c.role_app_id"
69           + "    and b.enabled = 'Y' "
70           + "    and c.role_id = d.role_id"
71           + "    and d.active_yn='Y'"
72           + "    and e.function_cd = c.function_cd"
73           + "    and c.app_id=:requestedAppId "
74           + "    and c.role_id =:roleId "
75           + "    and e.app_id = c.app_id",
76     resultSetMapping = "GlobalRoleWithApplicationRoleFunction"
77 )
78
79 @SqlResultSetMapping(
80     name = "GlobalRoleWithApplicationRoleFunction",
81     classes = @ConstructorResult(
82         targetClass = GlobalRoleWithApplicationRoleFunction.class,
83         columns = {
84             @ColumnResult(name = "roleId"),
85             @ColumnResult(name = "roleName"),
86             @ColumnResult(name = "active"),
87             @ColumnResult(name = "priority"),
88             @ColumnResult(name = "functionCd"),
89             @ColumnResult(name = "functionName"),
90             @ColumnResult(name = "appId"),
91             @ColumnResult(name = "roleAppId")
92         }
93     )
94 )
95
96
97 @Getter
98 @Setter
99 @ToString
100 @Builder
101 @NoArgsConstructor
102 @AllArgsConstructor
103 public class GlobalRoleWithApplicationRoleFunction implements Serializable {
104
105   private static final long serialVersionUID = 1L;
106
107   private Long roleId;
108   private String roleName;
109   private Boolean active;
110   private Integer priority;
111   private String functionCd;
112   private String functionName;
113   private Long appId;
114   private Long roleAppId;
115
116 }