This is simple example, originary code is

Code:

var a_DetachedCriteria = DetachedCriteria.For<UserDO>();
    a_DetachedCriteria
    .SetProjection(Property.ForName("ID"))
    .Add<UserDO>(x => x.Login == a_UserLogon)
    .Add<UserDO>(u => u.Password == a_UserPsw)
    .Add<UserDO>(u => u.Status == UserStatus.Actual)
    .SetMaxResults(1);

IList<UserDO> a_UserLst =
DataProviderNative.Session.CreateCriteria<UserDO>()
    .Instance
    .Add(Subqueries.PropertyIn("ID",a_DetachedCriteria))
    .List<UserDO>();

As result of code, Nhibernate generate the sql with missing parameter:

SELECT this_.ID AS id16_0_, this_.VERSION AS version16_0_,
       this_.login AS login16_0_, this_.PASSWORD AS password16_0_,
       this_.surname AS surname16_0_, this_.firstname AS
firstname16_0_,
       this_.patronymic AS patronymic16_0_, this_.job AS job16_0_,
       this_.privatecode AS privatec9_16_0_,
       this_.organisation AS organis10_16_0_, this_.phone AS
phone16_0_,
       this_.email AS email16_0_, this_.info AS info16_0_,
       this_.status AS status16_0_, this_.official AS official16_0_
  FROM adm$user this_
 WHERE this_.ID IN (
          SELECT *
            FROM (SELECT this_0_.ID AS y0_
                    FROM adm$user this_0_
                   WHERE this_0_.login = :p0
                     AND this_0_.PASSWORD = :p1
                     AND this_0_.status = :p2)
           WHERE ROWNUM <= :p3
                              )


; :p0 = 'admin', :p1 = 'admin', :p2 = '5'

Parameter :p3 are missing. What do I do wrong or am I just missing
something? Any comments?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to