我设计的一个权限模块,主要表有用户表 user
角色表 role
权限菜单表 treemenu
用户角色中间表  user_role
角色菜单中间表  role_treemenu映射时,用户和角色我做的是many-to-many ,但如果这样的话,给用户添加多个角色之后,权限菜单就会查询出重复的?
不知道怎么去重
最后我又改成many-to-one了,也就是一个用户只能有一个角色,managerrole.hbm.xml中:
       <!-- 角色与管理员  :  one-to-many -->
        <set name="managers"  table="ManagerAndManagerRole"  cascade="save-update"  schema="fastfood">
            <key>
               <column name="managerRoleId" precision="9" scale="0" not-null="true"></column>
            </key>
            <one-to-many entity-name="com.hsg.pojos.Manager" >
                <column name="managerId" precision="9" scale="0" not-null="true"></column>
            </one-to-many>
        </set>注意:它会提示这个错误:The content of element type "one-to-many" must match "EMPTY".请大家看看是怎么回事,到底怎么做才好,谢谢了