2 <!DOCTYPE hibernate-mapping PUBLIC
3 "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
4 "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
8 <class name="org.wamblee.usermgt.User" table="USERS" select-before-update="true">
9 <id name="primaryKey" column="ID" type="long">
10 <generator class="native"/>
12 <version name="persistedVersion" column="VERSION"/>
13 <property name="name" column="NAME" unique="true"/>
14 <property name="passwordString" column="PASSWORD"/>
15 <set name="groupSet" table="USER_GROUPS" lazy="false">
16 <key column="USER_ID"/>
17 <many-to-many class="org.wamblee.usermgt.Group" column="GROUP_ID"/>
21 <query name="findUserByName">
22 from org.wamblee.usermgt.User user where user.name = :name
25 <query name="findUserByGroupName">
27 from org.wamblee.usermgt.User user
28 join user.groupSet grp
29 where grp.name = :name
32 <query name="countUsers">
34 from org.wamblee.usermgt.User user