]> SALOME platform Git repositories - tools/siman.git/blob - Workspace/Siman-Common/src/org/splat/dal/bo/kernel/User.hbm.xml
Salome HOME
321253aa6d0823c17361662f293e143750a3a9f6
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / dal / bo / 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-2014
9 -->
10
11 <hibernate-mapping>
12
13         <!-- Class User 
14         -->
15         <union-subclass name="org.splat.dal.bo.kernel.User"
16                 extends="org.splat.dal.bo.kernel.Persistent" table="users"
17                 lazy="false">
18                 
19                 <!--     <natural-id>-->
20                 <property name="username" column="username" access="field" />
21                 <many-to-one name="role" column="username" insert="false"
22                         update="false" unique="true" cascade="merge,save-update" access="field" />
23                 <property name="email" column="email" access="field" />
24                 <!--     </natural-id>-->
25                 
26                 <property name="password" column="password" access="field" />
27                 <property name="first" column="first" access="field"
28                         not-null="true" />
29                 <property name="last" column="last" access="field"
30                         not-null="true" />
31                 <property name="display" column="display" access="field" />
32                 <property name="organid" column="organid" access="field" />
33         </union-subclass>
34
35         <!-- Class Role 
36         -->
37         <class name="org.splat.dal.bo.kernel.Role" table="role"
38                 lazy="false">
39                 <id name="username" column="username" access="field">
40                         <generator class="assigned" />
41                 </id>
42                 <property name="role" column="role" access="field"
43                         not-null="true" />
44         </class>
45
46 </hibernate-mapping>