Salome HOME
885767e7a948788057916428ec7c53d211da957b
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / kernel / User.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 User class and its corresponding Role definition.
5   - User and Role are associated by a one-to-one association on the username User foreign key.
6   -
7   - @author    Daniel Brunier-Coulin
8   - @copyright OPEN CASCADE 2012
9   -->
10
11 <hibernate-mapping>
12
13 <!-- Class User 
14   -->
15   <class name="org.splat.kernel.User" table="user" lazy="false">
16     <id name="rid" column="rid" access="field">
17       <generator class="increment"/>
18     </id>
19     <natural-id>
20       <property    name="username" column="username" access="field" />
21       <many-to-one name="role"     column="username" insert="false" update="false" unique="true" cascade="save-update" access="field" />
22       <property    name="email"    column="email"    access="field" />
23     </natural-id>
24     <property    name="password"   column="password" access="field" />
25     <property    name="first"      column="first"    access="field" not-null="true" />
26     <property    name="last"       column="last"     access="field" not-null="true" />
27     <property    name="display"    column="display"  access="field" />
28     <property    name="organid"    column="organid"  access="field" />
29   </class>
30   
31 <!-- Class Role 
32   -->
33   <class name="org.splat.kernel.Role" table="role" lazy="false">
34     <id name="username" column="username" access="field">
35       <generator class="assigned"/>
36     </id>
37     <property    name="role"     column="role"     access="field" not-null="true" />
38   </class>
39   
40 </hibernate-mapping>