diff options
Diffstat (limited to 'ecomp-portal-BE/war/WEB-INF/fusion/orm/Fusion.hbm.xml')
-rw-r--r-- | ecomp-portal-BE/war/WEB-INF/fusion/orm/Fusion.hbm.xml | 372 |
1 files changed, 372 insertions, 0 deletions
diff --git a/ecomp-portal-BE/war/WEB-INF/fusion/orm/Fusion.hbm.xml b/ecomp-portal-BE/war/WEB-INF/fusion/orm/Fusion.hbm.xml new file mode 100644 index 00000000..53c45b79 --- /dev/null +++ b/ecomp-portal-BE/war/WEB-INF/fusion/orm/Fusion.hbm.xml @@ -0,0 +1,372 @@ +<?xml version="1.0"?> +<!-- + ================================================================================ + eCOMP Portal + ================================================================================ + Copyright (C) 2017 AT&T Intellectual Property + ================================================================================ + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + ================================================================================ + --> + +<!DOCTYPE hibernate-mapping PUBLIC + "-//Hibernate/Hibernate Mapping DTD 3.0//EN" + "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> + +<hibernate-mapping package="org.openecomp.portalsdk.core.domain"> + + <!-- User class mapping details --> + <class name="User" table="FN_USER"> + <id name="id" column="user_id" > + <generator class="native"> + <param name="sequence">seq_fn_user</param> + </generator> + </id> + + <property name="orgId" column="org_id"/> + <property name="managerId" column="manager_id"/> + <property name="firstName" column="first_name"/> + <property name="middleInitial" column="middle_name"/> + <property name="lastName" column="last_name"/> + <property name="phone" column="phone"/> + <property name="fax" column="fax"/> + <property name="cellular" column="cellular"/> + <property name="email" column="email"/> + <property name="addressId" column="address_id"/> + <property name="alertMethodCd" column="alert_method_cd"/> + + <property name="address1" column="address_line_1"/> + <property name="address2" column="address_line_2"/> + <property name="city" column="city"/> + <property name="state" column="state_cd"/> + <property name="zipCode" column="zip_code"/> + <property name="country" column="country_cd"/> + + <property name="hrid" column="hrid"/> + <property name="orgUserId" column="org_user_id"/> + <property name="orgCode" column="org_code"/> + <property name="loginId" column="login_id"/> + <property name="loginPwd" column="login_pwd"/> + <property name="lastLoginDate" column="last_login_date" type="timestamp"/> + + <property name="locationClli" column="location_clli" /> + <property name="orgManagerUserId" column="org_manager_userid" /> + <property name="company" column="company" /> + <property name="department" column="department" /> + <property name="departmentName" column="department_name" /> + <property name="businessUnit" column="business_unit" /> + <property name="businessUnitName" column="business_unit_name" /> + <property name="jobTitle" column="job_title" /> + <property name="siloStatus" column="silo_status" /> + <property name="financialLocCode" column="fin_loc_code" /> + + <property name="active" column="active_yn" type="yes_no"/> + <property name="internal" column="is_internal_yn" type="yes_no"/> + + <property name="created" type="timestamp" column="created_date" /> + <property name="modified" type="timestamp" column="modified_date" /> + + <property name="createdId" column="created_id" /> + <property name="modifiedId" column="modified_id" /> + <property name="timeZoneId" column="timezone" /> + + <set name="userApps" table="FN_USER_ROLE" lazy="false" sort="natural" inverse="true" cascade="all-delete-orphan"> + <key column="user_id"/> + <one-to-many class="org.openecomp.portalsdk.core.domain.UserApp" /> + </set> + + <set name="pseudoRoles" table="FN_USER_PSEUDO_ROLE" lazy="false" sort="natural"> + <key column="user_id"/> + <many-to-many column="pseudo_role_id" class="org.openecomp.portalsdk.core.domain.Role" /> + </set> + </class> + + <class name="UserApp" table="fn_user_role"> + <composite-id> + <key-property name="userId" type="long"> + <column name="user_id" precision="11" scale="0" /> + </key-property> + <key-many-to-one name="app" class="org.openecomp.portalsdk.core.domain.App" column="app_id" /> + <key-many-to-one name="role" class="org.openecomp.portalsdk.core.domain.Role" column="role_id" /> + </composite-id> + <property name="priority" type="java.lang.Short"> + <column name="priority" precision="4" scale="0" /> + </property> + </class> + + <!-- User App class mapping details --> + <class name="App" table="fn_app"> + <id name="id" column="app_id"/> + <property name="name" column="app_name"/> + <property name="appPassword" column="app_password"/> + <property name="username" column="app_username"/> + + </class> + + <!-- User Role class mapping details --> + <class name="Role" table="FN_ROLE"> + <id name="id" column="role_id"> + <generator class="native"> + <param name="sequence">seq_fn_role</param> + </generator> + </id> + + <property name="name" column="role_name"/> + <property name="priority" column="priority" /> + <property name="active" column="active_yn" type="yes_no"/> + + <set name="roleFunctions" table="FN_ROLE_FUNCTION" lazy="false" sort="natural"> + <key column="role_id"/> + <many-to-many column="function_cd" class="org.openecomp.portalsdk.core.domain.RoleFunction"/> + </set> + + <set name="childRoles" table="FN_ROLE_COMPOSITE" lazy="false" sort="natural"> + <key column="parent_role_id"/> + <many-to-many column="child_role_id" class="org.openecomp.portalsdk.core.domain.Role"/> + </set> + + <set name="parentRoles" table="FN_ROLE_COMPOSITE" lazy="false" sort="natural"> + <key column="child_role_id"/> + <many-to-many column="parent_role_id" class="org.openecomp.portalsdk.core.domain.Role"/> + </set> + + </class> + + + + <!-- User Role Function class mapping details --> + <class name="RoleFunction" table="FN_FUNCTION"> + <id name="code" column="function_cd" /> + <property name="name" column="function_name" /> + </class> + + <!-- Menu class mapping details --> + <class name="Menu" table="FN_MENU"> + <id name="id" column="menu_id"> + <generator class="native"> + <param name="sequence">seq_fn_menu</param> + </generator> + </id> + + <property name="menuLevel" column="level-1"/> + <property name="label" column="label"/> + <property name="parentId" column="parent_id"/> + <property name="action" column="action"/> + <property name="functionCd" column="function_cd"/> + <property name="sortOrder" column="sort_order"/> + <property name="servlet" column="servlet"/> + <property name="queryString" column="query_string"/> + <property name="externalUrl" column="external_url"/> + <property name="target" column="target"/> + <property name="active" column="active_yn" type="yes_no"/> + <property name="separator" column="separator_yn" type="yes_no"/> + <property name="imageSrc" column="image_src" /> + </class> + + <class name="MenuData" table="FN_MENU"> + <!-- <id name="id" column="menu_id"/> --> + <id name="id" column="menu_id"> + <generator class="native"> + <param name="sequence">seq_fn_menu</param> + </generator> + </id> + <property name="label" column="label"/> + <property name="action" column="action"/> + <property name="functionCd" column="function_cd"/> + <property name="sortOrder" column="sort_order"/> + <property name="servlet" column="servlet"/> + <property name="queryString" column="query_string"/> + <property name="externalUrl" column="external_url"/> + <property name="target" column="target"/> + <property name="active" column="active_yn" type="yes_no"/> + <property name="separator" column="separator_yn" type="yes_no"/> + <property name="imageSrc" column="image_src" /> + <property name="menuSetCode" column="menu_set_cd" /> + + <many-to-one name="parentMenu" column="parent_id" class="MenuData"/> + + <set name="childMenus" lazy="false" sort="natural" inverse="true" where="active_yn = 'Y'"> + <key column="parent_id"/> + <one-to-many class="MenuData"/> + </set> + </class> + + <!-- Broadcast Message class mapping details --> + <class name="BroadcastMessage" table="fn_broadcast_message"> + <id name="id" column="message_id"> + <generator class="native"> + <param name="sequence">seq_fn_broadcast_message</param> + </generator> + </id> + <property name="messageText" column="message_text"/> + <property name="locationId" column="message_location_id"/> + + <property name="startDate" column="broadcast_start_date" type="timestamp"/> + <property name="endDate" column="broadcast_end_date" type="timestamp"/> + + <property name="sortOrder" column="sort_order"/> + <property name="active" column="active_yn" type="yes_no"/> + + <property name="siteCd" column="broadcast_site_cd" /> + </class> + + <!-- State Lookup class mapping details --> + <class name="LuState" table="FN_LU_STATE"> + <id name="abbr" column="state_cd" /> + <property name="state" /> + </class> + + <!-- Country Lookup class mapping details --> + <class name="LuCountry" table="FN_LU_COUNTRY"> + <id name="abbr" column="country_cd" /> + <property name="country" /> + <property name="fullName" column="full_name" /> + <property name="webphoneCountryLabel" column="fullwebphone_country_label_name" /> + </class> + + <class name="LuTimeZone" table="FN_LU_TIMEZONE"> + <id name="timezoneId" column="timezone_id" /> + <property name="name" column="timezone_name" /> + <property name="value" column="timezone_value" /> + </class> + + + <!-- Lookup (id/value bean) class mapping details --> + <class name="Lookup"> + <composite-id name="nameValueId" class="org.openecomp.portalsdk.core.domain.support.NameValueId"> + <key-property name="val"/> + <key-property name="lab" /> + </composite-id> + </class> + + <class name="UrlsAccessible" table="V_URL_ACCESS"> + <composite-id name="urlsAccessibleKey" class="org.openecomp.portalsdk.core.domain.UrlsAccessibleKey"> + <key-property name="url" column="url"/> + <key-property name="functionCd" column="function_cd"/> + </composite-id> + </class> + + <query name="functionCDlist"> + select distinct functionCd from MenuData + </query> + + <query name="menuData"> + from MenuData where menuSetCode = :menu_set_cd and parentMenu is null + </query> + <query name="restrictedUrls"> + FROM UrlsAccessible A where upper(A.urlsAccessibleKey.url) = upper(:current_url) + </query> + + <query name="getUserNameById"> + select firstName, lastName from User where id = :user_id + </query> + + <query name="getUserEmail"> + select email from User where id = :user_id + </query> + + <query name="getAllUsers"> + select id, firstName, lastName from User where active = true order by lastName, firstName + </query> + + <query name="getRoleNameById"> + select name from Role where id = :role_id + </query> + + <query name="getAllRoles"> + select id, name from Role order by name + </query> + + <sql-query name="getBytesPublishedDelivered"> + <return-scalar column="Published" type="java.lang.String"/> + <return-scalar column="Delivered" type="java.lang.String"/> + <![CDATA[ + select concat(Round(sum(bytespublished)/(1024*1024*1024*1024), 0), ' Pb') 'Published', concat(Round(sum(bytesdelivered)/(1024*1024*1024*1024), 0), ' Pb') ' Delivered' from kpi_drvolumes where day = (select max(day) from kpi_drvolumes) + ]]> + </sql-query> + + <sql-query name="getDataRouterFeedStats"> + <return-scalar column="TOTAL_FEEDS" type="java.lang.Long"/> + <return-scalar column="ACTIVE_FEEDS" type="java.lang.Long"/> + <return-scalar column="ACTIVE_SUBS" type="java.lang.Long"/> + <![CDATA[ + SELECT SUM(TOTALFEEDS) TOTAL_FEEDS, SUM(ACTIVEFEEDS) ACTIVE_FEEDS, SUM(ACTIVESUBS) ACTIVE_SUBS FROM kpi_drsumm where day = (select max(day) from kpi_drvolumes) + ]]> + </sql-query> + + <sql-query name="getLOCStatsCat"> + <![CDATA[ + select CATEGORY1 CATEGORY from demo_kpi_sourcecode_stats group by category1 + ]]> + </sql-query> + + <sql-query name="getLOCStats"> + <![CDATA[ + select sum(total_lines) TOTAL_LINES from demo_kpi_sourcecode_stats group by category1 + ]]> + </sql-query> + + <sql-query name="relatedUsers"> + <return-scalar column="ORG_USER_ID" type="java.lang.String"/> + + <![CDATA[ + + select t.org_user_id from ( + select distinct c.org_user_id ORG_USER_ID, c.last_login_date + from + fn_user_role a, + (select distinct role_id, app_id from fn_user_role a1, fn_user a2 where a1.user_id = a2.user_id and a2.org_user_id=:org_user_id) b, + fn_user c + where a.ROLE_ID = b.role_id + and a.APP_ID = b.app_id + and a.USER_ID = c.user_id + order by c.last_login_date desc limit 10 + ) t + + + ]]> + </sql-query> + + <sql-query name="relatedUserVOs"> + <return-scalar column="ORG_USER_ID" type="java.lang.String"/> + <return-scalar column="EMAIL" type="java.lang.String"/> + + <![CDATA[ + + select t.org_user_id, t.email from ( + select distinct c.org_user_id ORG_USER_ID, c.email, c.last_login_date + from + fn_user_role a, + (select distinct role_id, app_id from fn_user_role a1, fn_user a2 where a1.user_id = a2.user_id and a2.org_user_id=:org_user_id) b, + fn_user c + where a.ROLE_ID = b.role_id + and a.APP_ID = b.app_id + and a.USER_ID = c.user_id + order by c.last_login_date desc limit 10 + ) t + + + ]]> + </sql-query> + + <query name="getCommonWidgetItem"> + from CommonWidget where category = :cat order by sortOrder, title + </query> + + <!-- <query name="getEventWidgetData"> + from EventWidget order by sortOrder + </query> --> + + +</hibernate-mapping> + |