异常代码:could not execute query
[ SELECT this_.Sno as Sno0_0_, this_.Sname as Sname0_0_, this_.Password as Password0_0_, this_.Sex as Sex0_0_, this_.Htime as Htime0_0_, this_.RoleName as RoleName0_0_, this_.CollegeName as CollegeN7_0_0_, this_.ClassName as ClassName0_0_, this_.Phone as Phone0_0_, this_.PoliticStatus as Politic10_0_0_, this_.Religion as Religion0_0_, this_.Nation as Nation0_0_, this_.Hno as Hno0_0_, this_.DepartNum as DepartNum0_0_ FROM User this_ WHERE this_.Sname = @p0 and this_.Password = @p1 ]
Positional parameters:  #0>2008011264 #1>1234
[SQL: SELECT this_.Sno as Sno0_0_, this_.Sname as Sname0_0_, this_.Password as Password0_0_, this_.Sex as Sex0_0_, this_.Htime as Htime0_0_, this_.RoleName as RoleName0_0_, this_.CollegeName as CollegeN7_0_0_, this_.ClassName as ClassName0_0_, this_.Phone as Phone0_0_, this_.PoliticStatus as Politic10_0_0_, this_.Religion as Religion0_0_, this_.Nation as Nation0_0_, this_.Hno as Hno0_0_, this_.DepartNum as DepartNum0_0_ FROM User this_ WHERE this_.Sname = @p0 and this_.Password = @p1]
我已经把*.hbm.xml设为嵌入式资源。用sql能查出,用icriteria就抛异常。

解决方案 »

  1.   

    NHI没接触太多。只能。帮你顶
      

  2.   

    sql语句
    把这个用常规转换一下,看下,哪里写飘了
      

  3.   

    常规装换?用原生sql是能查出数据的
      

  4.   

    把你这段SQL 放到SQL查询分析器里跑一下 看哪块的错误你直接使用SQL 查询的吧
      

  5.   

    nhibernate生成的sql:SELECT this_.Sno as Sno0_0_, this_.Sname as Sname0_0_, this_.Password as Password0_0_, this_.Sex as Sex0_0_, this_.Htime as Htime0_0_, this_.RoleName as RoleName0_0_, this_.CollegeName as CollegeN7_0_0_, this_.ClassName as ClassName0_0_, this_.Phone as Phone0_0_, this_.PoliticStatus as Politic10_0_0_, this_.Religion as Religion0_0_, this_.Nation as Nation0_0_, this_.Hno as Hno0_0_, this_.DepartNum as DepartNum0_0_ FROM User this_ WHERE this_.Sname = '2008011' and this_.Password = '1234'