some corrections and parent-child-relation of topic
[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="255"
34     />
35     <property
36         name="subtitle"
37         type="java.lang.String"
38         column="subtitle"
39         length="128"
40     />
41     <property
42         name="edittitle"
43         type="java.lang.String"
44         column="edittitle"
45         length="128"
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         sql-type="text" 
89     />
90     <property
91         name="comment"
92         type="java.lang.String"
93         column="comment"
94         sql-type="text" 
95     />
96     <property
97         name="source"
98         type="java.lang.String"
99         column="source"
100         length="255"
101     />
102     <property
103         name="publishDate"
104         type="java.sql.Timestamp"
105         column="publish_date"
106         length="8"
107     />
108     <property
109         name="publishServer"
110         type="java.lang.String"
111         column="publish_server"
112         length="255"
113     />
114     <property
115         name="publishPath"
116         type="java.lang.String"
117         column="publish_path"
118         length="255"
119     />
120     <property
121         name="published"
122         type="boolean"
123         column="is_published"
124         not-null="true"
125         length="1"
126     />
127     <property
128         name="produced"
129         type="boolean"
130         column="is_produced"
131         not-null="true"
132         length="1"
133     />
134     <property
135         name="webdbCreate"
136         type="java.sql.Timestamp"
137         column="webdb_create"
138         not-null="true"
139         length="8"
140     />
141     <property
142         name="webdbLastchange"
143         type="java.sql.Timestamp"
144         column="webdb_lastchange"
145         length="8"
146     />
147     <property
148         name="html"
149         type="boolean"
150         column="is_html"
151         not-null="true"
152         length="1"
153         />
154     <property
155         name="contentData"
156         type="java.lang.String"
157         column="content_data"
158         sql-type="text" 
159     />
160     <!-- associations -->
161     <many-to-one
162         name="articleType"
163         class="mir.core.model.ArticleType"
164         column="to_article_type"
165     />
166     <many-to-one
167         name="publisher"
168         class="mir.core.model.MirUser"
169         column="to_publisher"
170     />
171     <many-to-one
172         name="language"
173         class="mir.core.model.Language"
174         column="to_language"
175     />
176     <many-to-one
177         name="rights"
178         class="mir.core.model.Rights"
179         column="to_rights"
180     /> 
181     <set 
182         name="childContent"
183         lazy="true" 
184         inverse="true" 
185         cascade="all">
186         <key 
187                 column="to_content"
188         />
189         <one-to-many 
190                 class="mir.core.model.Content"
191         />
192     </set>
193     <many-to-one
194         name="parentContent"
195         class="mir.core.model.Content"
196         column="to_content"
197     />
198     <set name="topics" table="content_x_topic">
199             <key column="content_id"/>
200             <many-to-many column="topic_id" class="mir.core.model.Topic"/>
201         </set> 
202     <set name="attachedMedias" table="content_x_media" lazy="true">
203             <key column="content_id"/>
204             <many-to-many column="media_id" class="mir.core.model.Media"/>
205         </set>
206 </class>
207 </hibernate-mapping>