some corrections and parent-child-relation of topic
[mir.git] / source / mir / core / model / Image.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.Image" 
17     table="images"
18     proxy="mir.core.model.IImage"
19 >
20     <id
21         name="id"
22         type="int"
23         column="id"
24     >
25         <generator class="sequence">
26                 <param name="sequence">media_id_seq</param> 
27         </generator> 
28     </id>
29     <property
30         name="title"
31         type="java.lang.String"
32         column="title"
33         not-null="true"
34         length="255"
35     />
36     <property
37         name="subtitle"
38         type="java.lang.String"
39         column="subtitle"
40         length="128"
41     />
42     <property
43         name="edittitle"
44         type="java.lang.String"
45         column="edittitle"
46         length="128"
47     />
48     <property
49         name="date"
50         type="java.lang.String"
51         column="date"
52         not-null="true"
53         length="8"
54     />
55     <property
56         name="creator"
57         type="java.lang.String"
58         column="creator"
59         length="80"
60     />
61     <property
62         name="creatorMainUrl"
63         type="java.lang.String"
64         column="creator_main_url"
65         length="255"
66     />
67     <property
68         name="creatorEmail"
69         type="java.lang.String"
70         column="creator_email"
71         length="80"
72     />
73     <property
74         name="creatorAddress"
75         type="java.lang.String"
76         column="creator_address"
77         length="80"
78     />
79     <property
80         name="creatorPhone"
81         type="java.lang.String"
82         column="creator_phone"
83         length="20"
84     />
85     <property
86         name="description"
87         type="java.lang.String"
88         column="description"
89         sql-type="text" 
90     />
91     <property
92         name="comment"
93         type="java.lang.String"
94         column="comment"
95         sql-type="text" 
96     />
97     <property
98         name="source"
99         type="java.lang.String"
100         column="source"
101         length="255"
102     />
103     <property
104         name="publishDate"
105         type="java.sql.Timestamp"
106         column="publish_date"
107         length="8"
108     />
109     <property
110         name="publishServer"
111         type="java.lang.String"
112         column="publish_server"
113         length="255"
114     />
115     <property
116         name="publishPath"
117         type="java.lang.String"
118         column="publish_path"
119         length="255"
120     />
121     <property
122         name="published"
123         type="boolean"
124         column="is_published"
125         not-null="true"
126         length="1"
127     />
128     <property
129         name="produced"
130         type="boolean"
131         column="is_produced"
132         not-null="true"
133         length="1"
134     />
135     <property
136         name="webdbCreate"
137         type="java.sql.Timestamp"
138         column="webdb_create"
139         not-null="true"
140         length="8"
141     />
142     <property
143         name="webdbLastchange"
144         type="java.sql.Timestamp"
145         column="webdb_lastchange"
146         length="8"
147     />
148
149     <property
150         name="iconIsProduced"
151         type="boolean"
152         column="icon_is_produced"
153         not-null="true"
154         length="1"
155     />
156     
157     <property
158         name="iconPath"
159         type="java.lang.String"
160         column="icon_path"
161         length="255"
162     />
163     <property
164         name="imageData"
165         type="int"
166         column="image_data"
167         length="4"
168     />
169     <property
170         name="iconData"
171         type="int"
172         column="icon_data"
173         length="4"
174     />
175     <property
176         name="year"
177         type="java.lang.String"
178         column="year"
179         length="40"
180     />
181     <property
182         name="imgWidth"
183         type="short"
184         column="img_width"
185         length="2"
186     />
187     <property
188         name="imgHeight"
189         type="short"
190         column="img_height"
191         length="2"
192     />
193     <property
194         name="iconWidth"
195         type="short"
196         column="icon_width"
197         length="2"
198     />
199     <property
200         name="iconHeight"
201         type="short"
202         column="icon_height"
203         length="2"
204     />              
205
206     <!-- associations -->
207     <many-to-one
208         name="mediaType"
209         class="mir.core.model.MediaType"
210         column="to_media_type"
211     />    
212     <many-to-one
213         name="mediaFolder"
214         class="mir.core.model.MediaFolder"
215         column="to_media_folder"
216     />
217     <many-to-one
218         name="publisher"
219         class="mir.core.model.MirUser"
220         column="to_publisher"
221     />
222     <many-to-one
223         name="language"
224         class="mir.core.model.Language"
225         column="to_language"
226     />
227     <many-to-one
228         name="rights"
229         class="mir.core.model.Rights"
230         column="to_rights"
231     />    
232     <set name="content" table="content_x_media" lazy="true">
233             <key column="media_id"/>
234             <many-to-many column="content_id" class="mir.core.model.Content"/>
235         </set>?
236 </class>
237 </hibernate-mapping>