Hi,
We're currently trying to create a query object for a table that has a couple of associations. Using the ICriteria interface (actually a DetachedCriteria at first), we dynamically check if we need to add criterias for the underlying associations, and we then do it by calling a CreateCriteria on the original object, and then add our criterias from there. The SQL we get in the end looks absolutely perfect, and the returned results are correct, but it looks like Nhibernate doesn't do a correct mapping of the returned set, so we get multiple duplicate objects (one for each row in the joined result set).
We've also tried to do the same query with HQL, and have had no problems getting this to map correctly.
Btw: We have based our query code on the example found here:
http://softlogger.com/5997/most-popular ... rnate.aspx
Thanks.