Hi I encountered a problem whilst using the 'DetachedCriteria' class. In my scenarion i have a users table, a user rights allocation table and a rights table. Basically what i do is select a right and assign that right to the user, that`s working fine.
My problem is when i want to query a user with rights A,B & C for example. I approached this problem as follows:
Code:
'user rights
userSearchCriteria.CreateAlias("rights", "rts")
userSearchCriteria.SetFetchMode("rights", NHibernate.FetchMode.Eager)
For Each listItem As ListItem In chkBoxRightsList.Items
userSearchCriteria.Add(Restrictions.Eq("rts.right.name", listItem.text))
Next
When i run the above code i get "{"could not resolve property: right.name".
I am assuming this is something related to incorrect use of alias creation, and in order to confirm that i created a simple code snippet where i query all user rights and that allowed me to access the right.name property, so class mappings appears to be fine.
Any help would be greatly appreciated
thanks in advance