some corrections and parent-child-relation of topic
[mir.git] / source / mir / core / model / Topic.hbm.xml
index cb0d9f2..c2e0c68 100755 (executable)
@@ -20,6 +20,7 @@
         name="id"
         type="int"
         column="id"
+        unsaved-value="0"
     >
         <generator class="sequence">
                <param name="sequence">topic_id_seq</param> 
@@ -36,7 +37,7 @@
         name="description"
         type="java.lang.String"
         column="description"
-        length="-1"
+        sql-type="text" 
     />
     <property
         name="filename"
     />
 
     <!-- associations -->
-    <set name="content" table="content_x_topic" lazy="true">
-           <key column="topic_id"/>
-           <many-to-many column="content_id" class="mir.core.model.Content"/>
-       </set> 
-       
-       <!--
+    <many-to-one name="parentTopic"
+       class="mir.core.model.Topic"
+       column="parent_id"
+       cascade="none"
+       not-null="false"/>      
+    
     <set 
-       name="childTopics"> 
-       inverse="true" 
-       cascade="all">
+       name="childTopics"
+       table="topic"
+       cascade="all"
+       inverse="true"
+       > 
        <key 
                column="parent_id"
        />
                class="mir.core.model.Topic"
         />
     </set>
-    <many-to-one 
-       name="parentTopic" 
-       column="parent_id" 
-       class="mir.core.model.Topic"
-    />
-    -->
 </class>
 </hibernate-mapping>