f6049961fdea34c7932e94e6c458b9a1b0d77da6
[so.git] / mso-catalog-db / src / main / resources / Service.hbm.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3   ============LICENSE_START=======================================================
4   ECOMP MSO
5   ================================================================================
6   Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
7   ================================================================================
8   Licensed under the Apache License, Version 2.0 (the "License");
9   you may not use this file except in compliance with the License.
10   You may obtain a copy of the License at
11
12        http://www.apache.org/licenses/LICENSE-2.0
13
14   Unless required by applicable law or agreed to in writing, software
15   distributed under the License is distributed on an "AS IS" BASIS,
16   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17   See the License for the specific language governing permissions and
18   limitations under the License.
19   ============LICENSE_END=========================================================
20   -->
21
22 <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
23
24 <hibernate-mapping package="org.openecomp.mso.db.catalog.beans">
25         <class name="Service" table="SERVICE">
26                 <meta attribute="class-description">
27                         This class describes a Service that may be orchestrated
28                 </meta>
29
30                 <id name="id" type="int" column="id">
31                         <generator class="native"/>
32                 </id>
33
34                 <properties name="uk" unique="true">
35                         <property name="serviceNameVersionId" type="string" >
36                                 <column name="SERVICE_NAME_VERSION_ID" length="50" not-null="true" default="'MANUAL_RECORD'" />
37                         </property>
38                         <property name="serviceName" column="SERVICE_NAME" type="string" length="40"/>
39                 </properties>
40
41                 <property name="version"  type="string" >
42                                 <column name="VERSION_STR" length="20" not-null="true"/>
43                 </property>
44                 <property name="description" column="DESCRIPTION" type="string" length="1200"/>
45
46                 <property name="serviceVersion" column="SERVICE_VERSION" type="string" length="10"/>
47                 <property name="httpMethod" column="HTTP_METHOD" type="string" length="50"/>
48                 <property name="created" type="timestamp" generated="insert" update="false" insert="false" >
49                    <column name="CREATION_TIMESTAMP" not-null="true"/>
50                 </property>
51                 <property name="modelInvariantUUID" type="string">
52            <column name="MODEL_INVARIANT_UUID" default="'MANUAL_RECORD'" not-null="true" length="200"/>
53         </property>
54
55                 <map name="recipes" cascade="all">
56                         <key column="SERVICE_ID"/>
57                         <map-key column="action" type="string"/>
58                         <one-to-many class="ServiceRecipe"/>
59                 </map>
60         </class>
61
62         <class name="ServiceRecipe" table="SERVICE_RECIPE">
63                 <meta attribute="class-description">
64                         This class describes a Service recipe
65                 </meta>
66
67                 <id name="id" type="int" column="id">
68                         <generator class="native"/>
69                 </id>
70
71                 <properties name="uk1_service_recipe" unique="true">
72                         <property name="serviceId" type="int">
73                              <column name="SERVICE_ID" not-null="true" length="11"/>
74                         </property>
75                         <property name="action" type="string" >
76                              <column name="ACTION" not-null="true" length="40"/>
77                         </property>
78                 </properties>
79                 <property name="version" type="string">
80                         <column name="VERSION_STR" not-null="false" length="20" default="null"/>
81                 </property>
82                 <property name="description" column="DESCRIPTION" type="string" length="1200"/>
83                 <property name="orchestrationUri" type="string">
84           <column name="ORCHESTRATION_URI" not-null="true" length="256"/>
85         </property>
86                 <property name="serviceParamXSD" column="SERVICE_PARAM_XSD" type="string" length="2048"/>
87                 <property name="recipeTimeout" column="RECIPE_TIMEOUT" type="int"/>
88                 <property name="serviceTimeoutInterim" column="SERVICE_TIMEOUT_INTERIM" type="java.lang.Integer"/>
89                 <property name="created" type="timestamp" generated="insert" update="false" insert="false" >
90                     <column name="CREATION_TIMESTAMP" not-null="true"/>
91                 </property>
92         </class>
93 </hibernate-mapping>