0b04fbdb97cd12d8f883c7b93482e1dad6503205
[mir.git] / source / mir / core / model / Content.hbm.xml
1 <?xml version="1.0"?>
2 <!DOCTYPE hibernate-mapping PUBLIC
3     "-//Hibernate/Hibernate Mapping DTD//EN"
4     "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >
5     
6 <hibernate-mapping>
7
8 <!-- 
9     Created by Middlegen Hibernate plugin
10
11     http://boss.bekk.no/boss/middlegen/
12     http://hibernate.sourceforge.net/
13 -->
14
15 <class 
16     name="mir.core.model.Content" 
17     table="content"
18 >
19     <id
20         name="id"
21         type="int"
22         column="id"
23     >
24         <generator class="sequence">
25                 <param name="sequence">media_id_seq</param> 
26         </generator> 
27     </id>
28     <property
29         name="title"
30         type="java.lang.String"
31         column="title"
32         not-null="true"
33         length="80"
34     />
35     <property
36         name="subtitle"
37         type="java.lang.String"
38         column="subtitle"
39         length="30"
40     />
41     <property
42         name="edittitle"
43         type="java.lang.String"
44         column="edittitle"
45         length="30"
46     />
47     <property
48         name="date"
49         type="java.lang.String"
50         column="date"
51         not-null="true"
52         length="8"
53     />
54     <property
55         name="creator"
56         type="java.lang.String"
57         column="creator"
58         length="80"
59     />
60     <property
61         name="creatorMainUrl"
62         type="java.lang.String"
63         column="creator_main_url"
64         length="255"
65     />
66     <property
67         name="creatorEmail"
68         type="java.lang.String"
69         column="creator_email"
70         length="80"
71     />
72     <property
73         name="creatorAddress"
74         type="java.lang.String"
75         column="creator_address"
76         length="80"
77     />
78     <property
79         name="creatorPhone"
80         type="java.lang.String"
81         column="creator_phone"
82         length="20"
83     />
84     <property
85         name="description"
86         type="java.lang.String"
87         column="description"
88         length="-1"
89     />
90     <property
91         name="keywords"
92         type="java.lang.String"
93         column="keywords"
94         length="-1"
95     />
96     <property
97         name="comment"
98         type="java.lang.String"
99         column="comment"
100         length="-1"
101     />
102     <property
103         name="source"
104         type="java.lang.String"
105         column="source"
106         length="255"
107     />
108     <property
109         name="publishDate"
110         type="java.sql.Timestamp"
111         column="publish_date"
112         length="8"
113     />
114     <property
115         name="publishServer"
116         type="java.lang.String"
117         column="publish_server"
118         length="255"
119     />
120     <property
121         name="publishPath"
122         type="java.lang.String"
123         column="publish_path"
124         length="255"
125     />
126     <property
127         name="published"
128         type="boolean"
129         column="is_published"
130         not-null="true"
131         length="1"
132     />
133     <property
134         name="produced"
135         type="boolean"
136         column="is_produced"
137         not-null="true"
138         length="1"
139     />
140     <property
141         name="webdbCreate"
142         type="java.sql.Timestamp"
143         column="webdb_create"
144         not-null="true"
145         length="8"
146     />
147     <property
148         name="webdbLastchange"
149         type="java.sql.Timestamp"
150         column="webdb_lastchange"
151         length="8"
152     />
153     <property
154         name="html"
155         type="boolean"
156         column="is_html"
157         not-null="true"
158         length="1"
159         />
160     <property
161         name="contentData"
162         type="java.lang.String"
163         column="content_data"
164         length="-1"
165     />
166     <!-- associations -->
167     <many-to-one
168         name="articleType"
169         class="mir.core.model.ArticleType"
170         column="to_article_type"
171     />
172     <many-to-one
173         name="feature"
174         class="mir.core.model.Feature"
175         column="to_feature"
176     />
177     <many-to-one
178         name="publisher"
179         class="mir.core.model.MirUser"
180         column="to_publisher"
181     />
182     <many-to-one
183         name="language"
184         class="mir.core.model.Language"
185         column="to_language"
186     />
187     <many-to-one
188         name="rights"
189         class="mir.core.model.Rights"
190         column="to_rights"
191     /> 
192     <set 
193         name="childContent"
194         lazy="true" 
195         inverse="true" 
196         cascade="all">
197         <key 
198                 column="to_content"
199         />
200         <one-to-many 
201                 class="mir.core.model.Content"
202         />
203     </set>
204     <many-to-one
205         name="parentContent"
206         class="mir.core.model.Content"
207         column="to_content"
208     />
209     <set name="topics" table="content_x_topic">
210             <key column="content_id"/>
211             <many-to-many column="topic_id" class="mir.core.model.Topic"/>
212         </set> 
213     <set name="attachedMedias" table="content_x_media" lazy="true">
214             <key column="content_id"/>
215             <many-to-many column="media_id" class="mir.core.model.Media"/>
216         </set>
217 </class>
218 </hibernate-mapping>