tags:

views:

28

answers:

1

I have a query that should return 72 unique records based on the userid field. The problem is that what I am getting is 72 copies of the first record.

Here is the query: return Session .CreateCriteria() .Add(Restrictions.Eq("UserId", id)) .List();

and here is what NUnit is running for the query: SELECT this_.USER_ID as USER1_12_0_, this_.RIGHTS_ID as RIGHTS2_12_0_, this_.FUNCTIONAL_AREA as FUNCTIONAL3_12_0_, this_.PERM_RIGHTS_ID as PERM4_12_0_ FROM PROFILE this_ WHERE this_.USER_ID = :p0;:p0 = 7943

When this query is run directly against Oracle - the results are correct.

A: 

Try using a mapping file generator and compare your mapping files as the problem most likely lies in your mapping files. There a plenty listed at http://nhforge.org/wikis/general/open-source-project-ecosystem.aspx. NhGen (http://sourceforge.net/projects/nhgen/) includes some very basic unit tests which might also assist you.

cdmdotnet