Salome HOME
f42acac232cf7b3cb0045185541934644d5f8848
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / som / Document.hbm.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
3 <!--
4   - Mapping of the Document class and its type information implemented by the DocumentType class.
5   -
6   - @author    Daniel Brunier-Coulin
7   - @copyright OPEN CASCADE 2012
8   -->
9
10 <hibernate-mapping>
11
12   <class name="org.splat.som.Document" table="document" lazy="false">
13
14 <!-- Properties inherited from Entity
15   -->
16     <id name="rid" type="int" column="rid" unsaved-value="0" access="field">
17       <generator class="org.splat.kernel.IDGenerator"/>
18     </id>
19     <set name="attributes" inverse="true" lazy="false" cascade="all-delete-orphan" access="field">
20       <key         column="owner" />
21       <one-to-many class="org.splat.kernel.Attribute" />
22     </set>
23     <set name="relations" inverse="true" lazy="false" cascade="all-delete-orphan" access="field">
24       <key         column="owner" />
25       <one-to-many class="org.splat.kernel.Relation" />
26     </set>
27   
28 <!-- Document properties
29   -
30   -      String        did       -->
31     <property name="did"       column="did"     access="field" not-null="true" />    
32     
33     <!-- DocumentType  type      -->    
34     <many-to-one name="type"   column="type"    access="field" not-null="true" />
35     
36     <!-- File          myfile    -->    
37     <many-to-one name="myfile" column="myfile" unique="true" cascade="all-delete-orphan" access="field" not-null="true" />
38     
39     <!-- String        name      -->    
40     <property name="name"      column="name"    access="field" not-null="true" />
41   
42     <!-- ProgressState state     -->
43     <property name="state"     column="state" type="ProgressState" access="field" not-null="true" />    
44     
45     <!-- int           step      -->    
46     <property name="step"      column="step"    access="field" not-null="true" />
47     
48     <!-- String        version   -->    
49     <property name="version"   column="version" access="field" />
50     
51     <!-- int           countag   -->    
52     <property name="countag"   column="countag" access="field" not-null="true" />
53     
54     <!-- int           history   -->    
55     <property name="history"   column="history" access="field" not-null="true" />
56   
57     <!-- User          author    -->    
58     <many-to-one name="author" column="author" access="field" not-null="true" />
59     
60     <!-- Date          lasdate   -->    
61     <property name="lasdate"   column="lasdate" access="field" not-null="true" />
62   </class>
63
64 <!-- Class DocumentType 
65   -->
66   <class name="org.splat.som.DocumentType" table="doctype" lazy="false">
67     <id name="rid" column="rid" access="field">
68       <generator class="increment"/>
69     </id>
70     <property name="name"   column="name"    access="field" not-null="true" />
71     <property name="state"  column="state" type="ProgressState" access="field" not-null="true" />    
72     <property name="step"   column="step"    access="field" not-null="true" />
73     <property name="result" column="result"  access="field" />
74     <set name="uses" table="docuse" lazy="false" access="field">
75       <key          column="owner" />
76       <many-to-many column="rid" class="org.splat.som.DocumentType" />
77     </set>
78   </class>
79   
80 </hibernate-mapping>