Aharoni, Pavel (pa0916) | ca3cb01 | 2018-10-22 15:29:57 +0300 | [diff] [blame] | 1 | <?xml version="1.0"?>
|
| 2 | <!--
|
| 3 | ============LICENSE_START==========================================
|
| 4 | ONAP Portal SDK
|
| 5 | ===================================================================
|
| 6 | Copyright © 2017 AT&T Intellectual Property. All rights reserved.
|
| 7 | ===================================================================
|
| 8 |
|
| 9 | Unless otherwise specified, all software contained herein is licensed
|
| 10 | under the Apache License, Version 2.0 (the “License”);
|
| 11 | you may not use this software except in compliance with the License.
|
| 12 | You may obtain a copy of the License at
|
| 13 |
|
| 14 | http://www.apache.org/licenses/LICENSE-2.0
|
| 15 |
|
| 16 | Unless required by applicable law or agreed to in writing, software
|
| 17 | distributed under the License is distributed on an "AS IS" BASIS,
|
| 18 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 19 | See the License for the specific language governing permissions and
|
| 20 | limitations under the License.
|
| 21 |
|
| 22 | Unless otherwise specified, all documentation contained herein is licensed
|
| 23 | under the Creative Commons License, Attribution 4.0 Intl. (the “License”);
|
| 24 | you may not use this documentation except in compliance with the License.
|
| 25 | You may obtain a copy of the License at
|
| 26 |
|
| 27 | https://creativecommons.org/licenses/by/4.0/
|
| 28 |
|
| 29 | Unless required by applicable law or agreed to in writing, documentation
|
| 30 | distributed under the License is distributed on an "AS IS" BASIS,
|
| 31 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 32 | See the License for the specific language governing permissions and
|
| 33 | limitations under the License.
|
| 34 |
|
| 35 | ============LICENSE_END============================================
|
| 36 |
|
| 37 |
|
| 38 | -->
|
| 39 |
|
| 40 | <!DOCTYPE hibernate-mapping PUBLIC
|
| 41 | "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
|
| 42 | "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
|
| 43 |
|
| 44 | <hibernate-mapping package="org.onap.portalsdk.core.domain">
|
| 45 |
|
| 46 | <!-- User class mapping details -->
|
| 47 | <class name="User" table="FN_USER">
|
| 48 | <id name="id" column="user_id" >
|
| 49 | <generator class="native">
|
| 50 | <param name="sequence">seq_fn_user</param>
|
| 51 | </generator>
|
| 52 | </id>
|
| 53 |
|
| 54 | <property name="orgId" column="org_id"/>
|
| 55 | <property name="managerId" column="manager_id"/>
|
| 56 | <property name="firstName" column="first_name"/>
|
| 57 | <property name="middleInitial" column="middle_name"/>
|
| 58 | <property name="lastName" column="last_name"/>
|
| 59 | <property name="phone" column="phone"/>
|
| 60 | <property name="fax" column="fax"/>
|
| 61 | <property name="cellular" column="cellular"/>
|
| 62 | <property name="email" column="email"/>
|
| 63 | <property name="addressId" column="address_id"/>
|
| 64 | <property name="alertMethodCd" column="alert_method_cd"/>
|
| 65 |
|
| 66 | <property name="address1" column="address_line_1"/>
|
| 67 | <property name="address2" column="address_line_2"/>
|
| 68 | <property name="city" column="city"/>
|
| 69 | <property name="state" column="state_cd"/>
|
| 70 | <property name="zipCode" column="zip_code"/>
|
| 71 | <property name="country" column="country_cd"/>
|
| 72 |
|
| 73 | <property name="hrid" column="hrid"/>
|
| 74 | <property name="orgUserId" column="org_user_id"/>
|
| 75 | <property name="orgCode" column="org_code"/>
|
| 76 | <property name="loginId" column="login_id"/>
|
| 77 | <property name="loginPwd" column="login_pwd"/>
|
| 78 | <property name="lastLoginDate" column="last_login_date" type="timestamp"/>
|
| 79 |
|
| 80 | <property name="locationClli" column="location_clli" />
|
| 81 | <property name="orgManagerUserId" column="org_manager_userid" />
|
| 82 | <property name="company" column="company" />
|
| 83 | <property name="department" column="department" />
|
| 84 | <property name="departmentName" column="department_name" />
|
| 85 | <property name="businessUnit" column="business_unit" />
|
| 86 | <property name="businessUnitName" column="business_unit_name" />
|
| 87 | <property name="jobTitle" column="job_title" />
|
| 88 | <property name="siloStatus" column="silo_status" />
|
| 89 | <property name="financialLocCode" column="fin_loc_code" />
|
| 90 |
|
| 91 | <property name="active" column="active_yn" type="yes_no"/>
|
| 92 | <property name="internal" column="is_internal_yn" type="yes_no"/>
|
| 93 |
|
| 94 | <property name="created" type="timestamp" column="created_date" />
|
| 95 | <property name="modified" type="timestamp" column="modified_date" />
|
| 96 |
|
| 97 | <property name="createdId" column="created_id" />
|
| 98 | <property name="modifiedId" column="modified_id" />
|
| 99 | <property name="timeZoneId" column="timezone" />
|
| 100 |
|
| 101 | <set name="userApps" table="FN_USER_ROLE" lazy="false" sort="natural" inverse="true" cascade="all-delete-orphan">
|
| 102 | <key column="user_id"/>
|
| 103 | <one-to-many class="org.onap.portalsdk.core.domain.UserApp" />
|
| 104 | </set>
|
| 105 |
|
| 106 | <set name="pseudoRoles" table="FN_USER_PSEUDO_ROLE" lazy="false" sort="natural">
|
| 107 | <key column="user_id"/>
|
| 108 | <many-to-many column="pseudo_role_id" class="org.onap.portalsdk.core.domain.Role" />
|
| 109 | </set>
|
| 110 | </class>
|
| 111 |
|
| 112 | <!-- Profile class mapping details;
|
| 113 | dupe of User class, but fewer fields -->
|
| 114 | <class name="Profile" table="FN_USER">
|
| 115 | <id name="id" column="user_id" >
|
| 116 | <generator class="increment"/>
|
| 117 | </id>
|
| 118 | <property name="first_name" column="first_name"/>
|
| 119 | <property name="last_name" column="last_name"/>
|
| 120 | <property name="email" column="email"/>
|
| 121 | <property name="orgManagerUserId" column="org_manager_userid" />
|
| 122 | <property name="active_yn" column="active_yn"/>
|
| 123 | <property name="orgUserId" column="org_user_id"/>
|
| 124 | </class>
|
| 125 |
|
| 126 | <class name="UserApp" table="fn_user_role">
|
| 127 | <composite-id>
|
| 128 | <key-property name="userId" type="long">
|
| 129 | <column name="user_id" precision="11" scale="0" />
|
| 130 | </key-property>
|
| 131 | <key-many-to-one name="app" class="org.onap.portalsdk.core.domain.App" column="app_id" />
|
| 132 | <key-many-to-one name="role" class="org.onap.portalsdk.core.domain.Role" column="role_id" />
|
| 133 | </composite-id>
|
| 134 | <property name="priority" type="java.lang.Short">
|
| 135 | <column name="priority" precision="4" scale="0" />
|
| 136 | </property>
|
| 137 | </class>
|
| 138 |
|
| 139 | <!-- App class mapping details -->
|
| 140 | <class name="App" table="fn_app">
|
| 141 | <id name="id" column="app_id"/>
|
| 142 | <property name="name" column="app_name"/>
|
| 143 | <property name="appPassword" column="app_password"/>
|
| 144 | <property name="username" column="app_username"/>
|
| 145 | <property name="imageUrl" column="app_image_url"/>
|
| 146 | <property name="description" column="app_description"/>
|
| 147 | <property name="notes" column="app_notes"/>
|
| 148 | <property name="url" column="app_url"/>
|
| 149 | <property name="alternateUrl" column="app_alternate_url"/>
|
| 150 | <property name="restEndpoint" column="app_rest_endpoint"/>
|
| 151 | <property name="mlAppName" column="ml_app_name"/>
|
| 152 | <property name="mlAppAdminId" column="ml_app_admin_id"/>
|
| 153 | <property name="motsId" column="mots_id"/>
|
| 154 | <property name="open" column="open"/>
|
| 155 | <property name="enabled" column="enabled"/>
|
| 156 | <property name="thumbnail" column="thumbnail" type="blob"/>
|
| 157 | <property name="uebKey" column="ueb_key"/>
|
| 158 | <property name="uebSecret" column="ueb_secret"/>
|
| 159 | <property name="uebTopicName" column="ueb_topic_name"/>
|
| 160 | </class>
|
| 161 |
|
| 162 |
|
| 163 | <!-- Audit Log class mapping details -->
|
| 164 | <class name="AuditLog" table="fn_audit_log">
|
| 165 | <id name="id" column="log_id">
|
| 166 | <!-- <generator class="sequence">
|
| 167 | <param name="sequence">seq_fn_audit_log</param>
|
| 168 | </generator> -->
|
| 169 | <generator class="native">
|
| 170 | <param name="sequence">seq_fn_audit_log</param>
|
| 171 | </generator>
|
| 172 | </id>
|
| 173 | <property name="activityCode" column="activity_cd"/>
|
| 174 | <property name="affectedRecordId" column="affected_record_id" />
|
| 175 | <property name="comments" column="comments" />
|
| 176 | <property name="createdId" column="user_id" />
|
| 177 | </class>
|
| 178 |
|
| 179 | <!-- User Role class mapping details -->
|
| 180 | <class name="Role" table="FN_ROLE">
|
| 181 | <id name="id" column="role_id">
|
| 182 | <generator class="native">
|
| 183 | <param name="sequence">seq_fn_role</param>
|
| 184 | </generator>
|
| 185 | </id>
|
| 186 |
|
| 187 | <property name="name" column="role_name"/>
|
| 188 | <property name="priority" column="priority" />
|
| 189 | <property name="active" column="active_yn" type="yes_no"/>
|
| 190 |
|
| 191 | <set name="roleFunctions" table="FN_ROLE_FUNCTION" lazy="false" sort="natural">
|
| 192 | <key column="role_id"/>
|
| 193 | <many-to-many column="function_cd" class="org.onap.portalsdk.core.domain.RoleFunction"/>
|
| 194 | </set>
|
| 195 |
|
| 196 | <set name="childRoles" table="FN_ROLE_COMPOSITE" lazy="false" sort="natural">
|
| 197 | <key column="parent_role_id"/>
|
| 198 | <many-to-many column="child_role_id" class="org.onap.portalsdk.core.domain.Role"/>
|
| 199 | </set>
|
| 200 |
|
| 201 | <set name="parentRoles" table="FN_ROLE_COMPOSITE" lazy="false" sort="natural">
|
| 202 | <key column="child_role_id"/>
|
| 203 | <many-to-many column="parent_role_id" class="org.onap.portalsdk.core.domain.Role"/>
|
| 204 | </set>
|
| 205 |
|
| 206 | </class>
|
| 207 |
|
| 208 |
|
| 209 |
|
| 210 | <!-- User Role Function class mapping details -->
|
| 211 | <class name="RoleFunction" table="FN_FUNCTION">
|
| 212 | <id name="code" column="function_cd" />
|
| 213 | <property name="name" column="function_name" />
|
| 214 | <property name="type" column="type" />
|
| 215 | <property name="action" column="action" />
|
| 216 | </class>
|
| 217 |
|
| 218 | <!-- Menu class mapping details -->
|
| 219 | <class name="Menu" table="FN_MENU">
|
| 220 | <id name="id" column="menu_id">
|
| 221 | <generator class="native">
|
| 222 | <param name="sequence">seq_fn_menu</param>
|
| 223 | </generator>
|
| 224 | </id>
|
| 225 |
|
| 226 | <!-- <property name="menuLevel" column="level-1"/> -->
|
| 227 | <property name="label" column="label"/>
|
| 228 | <property name="parentId" column="parent_id"/>
|
| 229 | <property name="action" column="action"/>
|
| 230 | <property name="functionCd" column="function_cd"/>
|
| 231 | <property name="sortOrder" column="sort_order"/>
|
| 232 | <property name="servlet" column="servlet"/>
|
| 233 | <property name="queryString" column="query_string"/>
|
| 234 | <property name="externalUrl" column="external_url"/>
|
| 235 | <property name="target" column="target"/>
|
| 236 | <property name="menuSetCode" column="menu_set_cd"/>
|
| 237 | <property name="active" column="active_yn" type="yes_no"/>
|
| 238 | <property name="separator" column="separator_yn" type="yes_no"/>
|
| 239 | <property name="imageSrc" column="image_src" />
|
| 240 | </class>
|
| 241 |
|
| 242 | <class name="MenuData" table="FN_MENU">
|
| 243 | <!-- <id name="id" column="menu_id"/> -->
|
| 244 | <id name="id" column="menu_id">
|
| 245 | <generator class="native">
|
| 246 | <param name="sequence">seq_fn_menu</param>
|
| 247 | </generator>
|
| 248 | </id>
|
| 249 | <property name="label" column="label"/>
|
| 250 | <property name="action" column="action"/>
|
| 251 | <property name="functionCd" column="function_cd"/>
|
| 252 | <property name="sortOrder" column="sort_order"/>
|
| 253 | <property name="servlet" column="servlet"/>
|
| 254 | <property name="queryString" column="query_string"/>
|
| 255 | <property name="externalUrl" column="external_url"/>
|
| 256 | <property name="target" column="target"/>
|
| 257 | <property name="active" column="active_yn" type="yes_no"/>
|
| 258 | <property name="separator" column="separator_yn" type="yes_no"/>
|
| 259 | <property name="imageSrc" column="image_src" />
|
| 260 | <property name="menuSetCode" column="menu_set_cd" />
|
| 261 |
|
| 262 | <many-to-one name="parentMenu" column="parent_id" class="MenuData"/>
|
| 263 |
|
| 264 | <set name="childMenus" lazy="false" sort="natural" inverse="true" where="active_yn = 'Y'">
|
| 265 | <key column="parent_id"/>
|
| 266 | <one-to-many class="MenuData"/>
|
| 267 | </set>
|
| 268 | </class>
|
| 269 |
|
| 270 | <!-- Broadcast Message class mapping details -->
|
| 271 | <class name="BroadcastMessage" table="fn_broadcast_message">
|
| 272 | <id name="id" column="message_id">
|
| 273 | <generator class="native">
|
| 274 | <param name="sequence">seq_fn_broadcast_message</param>
|
| 275 | </generator>
|
| 276 | </id>
|
| 277 | <property name="messageText" column="message_text"/>
|
| 278 | <property name="locationId" column="message_location_id"/>
|
| 279 |
|
| 280 | <property name="startDate" column="broadcast_start_date" type="timestamp"/>
|
| 281 | <property name="endDate" column="broadcast_end_date" type="timestamp"/>
|
| 282 |
|
| 283 | <property name="sortOrder" column="sort_order"/>
|
| 284 | <property name="active" column="active_yn" type="yes_no"/>
|
| 285 |
|
| 286 | <property name="siteCd" column="broadcast_site_cd" />
|
| 287 | </class>
|
| 288 |
|
| 289 |
|
| 290 | <!-- State Lookup class mapping details -->
|
| 291 | <class name="LuState" table="FN_LU_STATE">
|
| 292 | <id name="abbr" column="state_cd" />
|
| 293 | <property name="state" />
|
| 294 | </class>
|
| 295 |
|
| 296 | <!-- Country Lookup class mapping details -->
|
| 297 | <class name="LuCountry" table="FN_LU_COUNTRY">
|
| 298 | <id name="abbr" column="country_cd" />
|
| 299 | <property name="country" />
|
| 300 | <property name="fullName" column="full_name" />
|
| 301 | <property name="webphoneCountryLabel" column="fullwebphone_country_label_name" />
|
| 302 | </class>
|
| 303 |
|
| 304 | <class name="LuTimeZone" table="FN_LU_TIMEZONE">
|
| 305 | <id name="timezoneId" column="timezone_id" />
|
| 306 | <property name="name" column="timezone_name" />
|
| 307 | <property name="value" column="timezone_value" />
|
| 308 | </class>
|
| 309 |
|
| 310 |
|
| 311 | <!-- Lookup (id/value bean) class mapping details -->
|
| 312 | <class name="Lookup">
|
| 313 | <composite-id name="nameValueId" class="org.onap.portalsdk.core.domain.support.NameValueId">
|
| 314 | <key-property name="val"/>
|
| 315 | <key-property name="lab" />
|
| 316 | </composite-id>
|
| 317 | </class>
|
| 318 |
|
| 319 | <class name="UrlsAccessible" table="V_URL_ACCESS">
|
| 320 | <composite-id name="urlsAccessibleKey" class="org.onap.portalsdk.core.domain.UrlsAccessibleKey">
|
| 321 | <key-property name="url" column="url"/>
|
| 322 | <key-property name="functionCd" column="function_cd"/>
|
| 323 | </composite-id>
|
| 324 | </class>
|
| 325 |
|
| 326 |
|
| 327 | <query name="ParentIdForLabelList">
|
| 328 | select distinct md.parentMenu.id from MenuData as md where md.label = :paramLabel and md.label is not null
|
| 329 | </query>
|
| 330 |
|
| 331 | <query name="IdForLabelList">
|
| 332 | select distinct md.id from MenuData as md where md.label = :paramLabel
|
| 333 | </query>
|
| 334 |
|
| 335 | <query name="parentList">
|
| 336 | select distinct md.id, md.label, md.parentMenu.id from MenuData as md where md.label is not null
|
| 337 | </query>
|
| 338 |
|
| 339 | <query name="functionCDlistOld">
|
| 340 | select distinct functionCd from MenuData
|
| 341 | </query>
|
| 342 |
|
| 343 | <query name="functionCDlist">
|
| 344 | select distinct code from RoleFunction
|
| 345 | </query>
|
| 346 |
|
| 347 | <query name="menuData">
|
| 348 | from MenuData where menuSetCode = :menu_set_cd and parentMenu is null
|
| 349 | </query>
|
| 350 | <query name="restrictedUrls">
|
| 351 | FROM UrlsAccessible A where upper(A.urlsAccessibleKey.url) = upper(:current_url)
|
| 352 | </query>
|
| 353 |
|
| 354 | <query name="getUserNameById">
|
| 355 | select firstName, lastName from User where id = :user_id
|
| 356 | </query>
|
| 357 |
|
| 358 | <query name="getUserEmail">
|
| 359 | select email from User where id = :user_id
|
| 360 | </query>
|
| 361 |
|
| 362 | <query name="getAllUsers">
|
| 363 | select id, firstName, lastName from User where active = true order by lastName, firstName
|
| 364 | </query>
|
| 365 |
|
| 366 | <query name="getRoleNameById">
|
| 367 | select name from Role where id = :role_id
|
| 368 | </query>
|
| 369 |
|
| 370 | <query name="getAllRoles">
|
| 371 | select id, name from Role order by name
|
| 372 | </query>
|
| 373 |
|
| 374 | <query name="getUserByProfileId">
|
| 375 | select orgUserId from User where id = :user_id
|
| 376 | </query>
|
| 377 |
|
| 378 | <query name="getUserIdByorgUserId">
|
| 379 | select id from User where orgUserId = :orgUserId
|
| 380 | </query>
|
| 381 |
|
| 382 | <query name="getUserByOrgUserId">
|
| 383 | FROM User WHERE orgUserId = :org_user_id
|
| 384 | </query>
|
| 385 |
|
| 386 | <query name="getUserByLoginId">
|
| 387 | FROM User WHERE loginId = :login_id
|
| 388 | </query>
|
| 389 |
|
| 390 | <query name="getUserByLoginIdLoginPwd">
|
| 391 | FROM User WHERE loginId = :login_id and loginPwd = :login_pwd
|
| 392 | </query>
|
| 393 |
|
| 394 | </hibernate-mapping>
|