2012-04-13 82 views
0

我正在將web項目asp.net VS2008遷移到VS2010,NH 2.1遷移到NH 3.2。NHibernate 3.2和尋呼Oracle

現在,使用NH 3.2的分頁不起作用。

NHibernate的3.2 SetFirstresult,Setmaxresults分頁問題甲骨文
https://groups.google.com/forum/#!topic/nhusers/1kp0hDfVol0

碼,同爲VS2008和VS2010,但使用NH 3.2,傳呼不工作

var response = new GetComunicacionesXFiltroResponse(); 

     //Sesion 
     using (ISession session = NHibernateHelper.OpenSession(FlushMode.Never)) 
     { 
      IQuery query = GetQueryForGetComunicacionesXFiltro(request, false, session); 
      if (request.PagingInfo != null) 
      { 
       query.SetMaxResults(request.PagingInfo.RowCount); 
       query.SetFirstResult((request.PagingInfo.PageNumber - 1) * request.PagingInfo.RowCount); 
      } 
      response.Comunicaciones = ComunicacionMapper.Map(query.List<Comunicacion>()); 

     } 

配置爲NH 3.2

<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2" > 
    <reflection-optimizer use="false"/> 
    <session-factory> 
    <property name="connection.connection_string_name">XXX.ConnectionStrings.Oracle.XXX</property> 
    <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property> 
    <property name="connection.driver_class">NHibernate.Driver.OracleDataClientDriver</property> 
    <property name="connection.isolation">ReadCommitted</property> 
    <property name="dialect">NHibernate.Dialect.Oracle9iDialect</property> 

    <property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property> 
    <property name="show_sql">false</property> 
    <property name="use_proxy_validator">false</property> 
    <!--DEPRECATED<property name="use_outer_join">true</property>--> 
    <mapping assembly="XXX.MonitorizacionB2b.DomainModel"/> 
    </session-factory> 
</hibernate-configuration> 

有什麼建議嗎?

回答