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