Hello everybody
I've a many-to-many connection with the objects User and Role. The appropriate part of the xml-configuration file of User is as follows:
Code:
bag name="Roles" table="RoleUsers">
<key column="UserName" />
<many-to-many column="RoleID" class="MF.DataLayer.Domain.Role" />
</bag>
What I want is to create a query that returns the User objects that have a specific role. It should look like following:
Code:
session.createQuery("FROM User u WHERE u.Roles.Name = :roleName")
Unfortunately the documentation lacks a little bit concerning queries with that kind of collections.
Could somebody give me a hint on this?