Salome HOME
Mapping is fixed. Relation in the mapping is inherited from Persistent now. Versionin...
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / dal / bo / kernel / User.hbm.xml
index 50479c7564f5973698bb8ae2fa509975b4f5b2c5..ffa5d73850b512423198492e3cf94c439b005db3 100644 (file)
@@ -1,37 +1,46 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
 <!--
-  - Mapping of the User class and its corresponding Role definition.
-  - User and Role are associated by a one-to-one association on the username User foreign key.
-  -
-  - @author    Daniel Brunier-Coulin
-  - @copyright OPEN CASCADE 2012
-  -->
+       - Mapping of the User class and its corresponding Role definition.
+       - User and Role are associated by a one-to-one association on the username User foreign key.
+       -
+       - @author    Daniel Brunier-Coulin
+       - @copyright OPEN CASCADE 2012
+-->
 
 <hibernate-mapping>
 
-<!-- Class User 
-  -->
-  <union-subclass name="org.splat.dal.bo.kernel.User" extends="org.splat.dal.bo.kernel.Persistent" table="users" lazy="false">
-<!--     <natural-id>-->
-      <property    name="username" column="username" access="field" />
-      <many-to-one name="role"     column="username" insert="false" update="false" unique="true" cascade="save-update" access="field" />
-      <property    name="email"    column="email"    access="field" />
-<!--     </natural-id>-->
-    <property    name="password"   column="password" access="field" />
-    <property    name="first"      column="first"    access="field" not-null="true" />
-    <property    name="last"       column="last"     access="field" not-null="true" />
-    <property    name="display"    column="display"  access="field" />
-    <property    name="organid"    column="organid"  access="field" />
-  </union-subclass>
-  
-<!-- Class Role 
-  -->
-  <class name="org.splat.dal.bo.kernel.Role" table="role" lazy="false">
-    <id name="username" column="username" access="field">
-      <generator class="assigned"/>
-    </id>
-    <property    name="role"     column="role"     access="field" not-null="true" />
-  </class>
-  
+       <!-- Class User 
+       -->
+       <union-subclass name="org.splat.dal.bo.kernel.User"
+               extends="org.splat.dal.bo.kernel.Persistent" table="users"
+               lazy="false">
+               
+               <!--     <natural-id>-->
+               <property name="username" column="username" access="field" />
+               <many-to-one name="role" column="username" insert="false"
+                       update="false" unique="true" cascade="save-update" access="field" />
+               <property name="email" column="email" access="field" />
+               <!--     </natural-id>-->
+               
+               <property name="password" column="password" access="field" />
+               <property name="first" column="first" access="field"
+                       not-null="true" />
+               <property name="last" column="last" access="field"
+                       not-null="true" />
+               <property name="display" column="display" access="field" />
+               <property name="organid" column="organid" access="field" />
+       </union-subclass>
+
+       <!-- Class Role 
+       -->
+       <class name="org.splat.dal.bo.kernel.Role" table="role"
+               lazy="false">
+               <id name="username" column="username" access="field">
+                       <generator class="assigned" />
+               </id>
+               <property name="role" column="role" access="field"
+                       not-null="true" />
+       </class>
+
 </hibernate-mapping>
\ No newline at end of file