Hello,
I have a collection property called "Rights" (ISet) with a "User" root object User. Im looking desesperately for a way to get an additionnal field
that would count the number of elements in my "Rights" Collection. I'd want also to have the User object as the returned parameter :
The following query don't seem to work, nhibernate claims for a more detailed description of User object.
Code:
select usr, count(rights) from User usr left join usr.Rights rights where usr.Name='myuser'
group by usr
gives the following exception :
System.ArgumentException: Item has already been added. Key in dictionary: 'usr' Key being added: 'usr'
Any idea ?
thanx in advance.
Sam
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 1.0.2
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt: