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