rebuilding head
[mir.git] / source / mir / core / model / Media.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.Media" 
17     table="media"
18     proxy="mir.core.model.IMedia"
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
31     <property
32         name="title"
33         type="java.lang.String"
34         column="title"
35         not-null="true"
36         length="255"
37     />
38     <property
39         name="subtitle"
40         type="java.lang.String"
41         column="subtitle"
42         length="128"
43     />
44     <property
45         name="edittitle"
46         type="java.lang.String"
47         column="edittitle"
48         length="128"
49     />
50     <property
51         name="date"
52         type="java.lang.String"
53         column="date"
54         not-null="true"
55         length="8"
56     />
57     <property
58         name="creator"
59         type="java.lang.String"
60         column="creator"
61         length="80"
62     />
63     <property
64         name="creatorMainUrl"
65         type="java.lang.String"
66         column="creator_main_url"
67         length="255"
68     />
69     <property
70         name="creatorEmail"
71         type="java.lang.String"
72         column="creator_email"
73         length="80"
74     />
75     <property
76         name="creatorAddress"
77         type="java.lang.String"
78         column="creator_address"
79         length="80"
80     />
81     <property
82         name="creatorPhone"
83         type="java.lang.String"
84         column="creator_phone"
85         length="20"
86     />
87     <property
88         name="description"
89         type="java.lang.String"
90         column="description"
91         sql-type="text" 
92     />
93     <property
94         name="comment"
95         type="java.lang.String"
96         column="comment"
97         sql-type="text" 
98     />
99     <property
100         name="source"
101         type="java.lang.String"
102         column="source"
103         length="255"
104     />
105     <property
106         name="publishDate"
107         type="java.sql.Timestamp"
108         column="publish_date"
109         length="8"
110     />
111     <property
112         name="publishServer"
113         type="java.lang.String"
114         column="publish_server"
115         length="255"
116     />
117     <property
118         name="publishPath"
119         type="java.lang.String"
120         column="publish_path"
121         length="255"
122     />
123     <property
124         name="published"
125         type="boolean"
126         column="is_published"
127         not-null="true"
128         length="1"
129     />
130     <property
131         name="produced"
132         type="boolean"
133         column="is_produced"
134         not-null="true"
135         length="1"
136     />
137     <property
138         name="webdbCreate"
139         type="java.sql.Timestamp"
140         column="webdb_create"
141         not-null="true"
142         length="8"
143     />
144     <property
145         name="webdbLastchange"
146         type="java.sql.Timestamp"
147         column="webdb_lastchange"
148         length="8"
149     />
150     
151     <!-- associations -->
152     
153     <many-to-one
154         name="publisher"
155         class="mir.core.model.MirUser"
156         column="to_publisher"
157     />
158
159     <many-to-one
160         name="language"
161         class="mir.core.model.Language"
162         column="to_language"
163     />
164
165     <many-to-one
166         name="rights"
167         class="mir.core.model.Rights"
168         column="to_rights"
169     /> 
170    
171     <set name="content" table="content_x_media" lazy="true">
172             <key column="media_id"/>
173             <many-to-many column="content_id" class="mir.core.model.Content"/>
174         </set>
175    
176 </class>
177 </hibernate-mapping>