Hibernate version: 2.0.0 GA
I'm using NHibernate 2.0.0 with SQL Server 2005 and 2005 dialect and I've some issues that was also il 1.2.0 release.
using a sample IQuery for fetch records all works well, but if i specify IQuery.SetMaxResults i receive an "AdoNetException: could not execute query".
This is the broken hql, using IQuery.SetFirstResult(0) and IQuery.SetMaxResults(98):
SELECT TOP 99 idClassT1_1_, Descrizi2_1_, NoLinee1_, Tipo1_, Tariffa1_, TipoLinea1_, DataIniz7_1_, DataFine8_1_, CodIva1_, Descriz10_1_, Descriz11_1_, Descriz12_1_, NoLinee13_1_, Tipo14_1_, Tariffa15_1_, TipoLinea16_1_, DataIni17_1_, DataFin18_1_, CodIva19_1_, Descriz20_1_, Descriz21_1_, Descriz22_1_, NoLinee23_1_, Tipo24_1_, Tariffa25_1_, TipoLinea26_1_, DataIni27_1_, DataFin28_1_, CodIva29_1_, Descriz30_1_, Descriz31_1_, Descriz32_1_, NoLinee33_1_, Tipo34_1_, Tariffa35_1_, TipoLinea36_1_, DataIni37_1_, DataFin38_1_, CodIva39_1_, Descriz40_1_, Descriz41_1_, Descriz42_1_, NoLinee43_1_, Tipo44_1_, Tariffa45_1_, TipoLinea46_1_, DataIni47_1_, DataFin48_1_, CodIva49_1_, Descriz50_1_, Descriz51_1_ FROM (SELECT ROW_NUMBER() OVER(ORDER BY __hibernate_sort_expr_0__) as row, query.idClassT1_1_, query.Descrizi2_1_, query.NoLinee1_, query.Tipo1_, query.Tariffa1_, query.TipoLinea1_, query.DataIniz7_1_, query.DataFine8_1_, query.CodIva1_, query.Descriz10_1_, query.Descriz11_1_, query.Descriz12_1_, query.NoLinee13_1_, query.Tipo14_1_, query.Tariffa15_1_, query.TipoLinea16_1_, query.DataIni17_1_, query.DataFin18_1_, query.CodIva19_1_, query.Descriz20_1_, query.Descriz21_1_, query.Descriz22_1_, query.NoLinee23_1_, query.Tipo24_1_, query.Tariffa25_1_, query.TipoLinea26_1_, query.DataIni27_1_, query.DataFin28_1_, query.CodIva29_1_, query.Descriz30_1_, query.Descriz31_1_, query.Descriz32_1_, query.NoLinee33_1_, query.Tipo34_1_, query.Tariffa35_1_, query.TipoLinea36_1_, query.DataIni37_1_, query.DataFin38_1_, query.CodIva39_1_, query.Descriz40_1_, query.Descriz41_1_, query.Descriz42_1_, query.NoLinee43_1_, query.Tipo44_1_, query.Tariffa45_1_, query.TipoLinea46_1_, query.DataIni47_1_, query.DataFin48_1_, query.CodIva49_1_, query.Descriz50_1_, query.Descriz51_1_, query.__hibernate_sort_expr_0__ FROM (select classtest0x0_.idClassTest as idClassT1_1_, classtest0x0_.Descrizione as Descrizi2_1_, classtest0x0_.NoLinee as NoLinee1_, classtest0x0_.Tipo as Tipo1_, classtest0x0_.Tariffa as Tariffa1_, classtest0x0_.TipoLinea as TipoLinea1_, classtest0x0_.DataInizioValidita as DataIniz7_1_, classtest0x0_.DataFineValidita as DataFine8_1_, classtest0x0_.CodIva as CodIva1_, classtest0x0_.Descrizione1 as Descriz10_1_, classtest0x0_.Descrizione2 as Descriz11_1_, classtest0x0_.Descrizione01 as Descriz12_1_, classtest0x0_.NoLinee01 as NoLinee13_1_, classtest0x0_.Tipo01 as Tipo14_1_, classtest0x0_.Tariffa01 as Tariffa15_1_, classtest0x0_.TipoLinea01 as TipoLinea16_1_, classtest0x0_.DataInizioValidita01 as DataIni17_1_, classtest0x0_.DataFineValidita01 as DataFin18_1_, classtest0x0_.CodIva01 as CodIva19_1_, classtest0x0_.Descrizione101 as Descriz20_1_, classtest0x0_.Descrizione201 as Descriz21_1_, classtest0x0_.Descrizione02 as Descriz22_1_, classtest0x0_.NoLinee02 as NoLinee23_1_, classtest0x0_.Tipo02 as Tipo24_1_, classtest0x0_.Tariffa02 as Tariffa25_1_, classtest0x0_.TipoLinea02 as TipoLinea26_1_, classtest0x0_.DataInizioValidita02 as DataIni27_1_, classtest0x0_.DataFineValidita02 as DataFin28_1_, classtest0x0_.CodIva02 as CodIva29_1_, classtest0x0_.Descrizione102 as Descriz30_1_, classtest0x0_.Descrizione202 as Descriz31_1_, classtest0x0_.Descrizione03 as Descriz32_1_, classtest0x0_.NoLinee03 as NoLinee33_1_, classtest0x0_.Tipo03 as Tipo34_1_, classtest0x0_.Tariffa03 as Tariffa35_1_, classtest0x0_.TipoLinea03 as TipoLinea36_1_, classtest0x0_.DataInizioValidita03 as DataIni37_1_, classtest0x0_.DataFineValidita03 as DataFin38_1_, classtest0x0_.CodIva03 as CodIva39_1_, classtest0x0_.Descrizione103 as Descriz40_1_, classtest0x0_.Descrizione203 as Descriz41_1_, classtest0x0_.Descrizione04 as Descriz42_1_, classtest0x0_.NoLinee04 as NoLinee43_1_, classtest0x0_.Tipo04 as Tipo44_1_, classtest0x0_.Tariffa04 as Tariffa45_1_, classtest0x0_.TipoLinea04 as TipoLinea46_1_, classtest0x0_.DataInizioValidita04 as DataIni47_1_, classtest0x0_.DataFineValidita04 as DataFin48_1_, classtest0x0_.CodIva04 as CodIva49_1_, classtest0x0_.Descrizione104 as Descriz50_1_, classtest0x0_.Descrizione204 as Descriz51_1_, classtest0x0_.idClassTest as __hibernate_sort_expr_0__ from ClassTestTable01 classtest0x0_) query ) page WHERE page.row > 1 ORDER BY __hibernate_sort_expr_0__
The same query without limit instructions works well:
select classtest0x0_.idClassTest as idClassT1_1_, classtest0x0_.Descrizione as Descrizi2_1_, classtest0x0_.NoLinee as NoLinee1_, classtest0x0_.Tipo as Tipo1_, classtest0x0_.Tariffa as Tariffa1_, classtest0x0_.TipoLinea as TipoLinea1_, classtest0x0_.DataInizioValidita as DataIniz7_1_, classtest0x0_.DataFineValidita as DataFine8_1_, classtest0x0_.CodIva as CodIva1_, classtest0x0_.Descrizione1 as Descriz10_1_, classtest0x0_.Descrizione2 as Descriz11_1_, classtest0x0_.Descrizione01 as Descriz12_1_, classtest0x0_.NoLinee01 as NoLinee13_1_, classtest0x0_.Tipo01 as Tipo14_1_, classtest0x0_.Tariffa01 as Tariffa15_1_, classtest0x0_.TipoLinea01 as TipoLinea16_1_, classtest0x0_.DataInizioValidita01 as DataIni17_1_, classtest0x0_.DataFineValidita01 as DataFin18_1_, classtest0x0_.CodIva01 as CodIva19_1_, classtest0x0_.Descrizione101 as Descriz20_1_, classtest0x0_.Descrizione201 as Descriz21_1_, classtest0x0_.Descrizione02 as Descriz22_1_, classtest0x0_.NoLinee02 as NoLinee23_1_, classtest0x0_.Tipo02 as Tipo24_1_, classtest0x0_.Tariffa02 as Tariffa25_1_, classtest0x0_.TipoLinea02 as TipoLinea26_1_, classtest0x0_.DataInizioValidita02 as DataIni27_1_, classtest0x0_.DataFineValidita02 as DataFin28_1_, classtest0x0_.CodIva02 as CodIva29_1_, classtest0x0_.Descrizione102 as Descriz30_1_, classtest0x0_.Descrizione202 as Descriz31_1_, classtest0x0_.Descrizione03 as Descriz32_1_, classtest0x0_.NoLinee03 as NoLinee33_1_, classtest0x0_.Tipo03 as Tipo34_1_, classtest0x0_.Tariffa03 as Tariffa35_1_, classtest0x0_.TipoLinea03 as TipoLinea36_1_, classtest0x0_.DataInizioValidita03 as DataIni37_1_, classtest0x0_.DataFineValidita03 as DataFin38_1_, classtest0x0_.CodIva03 as CodIva39_1_, classtest0x0_.Descrizione103 as Descriz40_1_, classtest0x0_.Descrizione203 as Descriz41_1_, classtest0x0_.Descrizione04 as Descriz42_1_, classtest0x0_.NoLinee04 as NoLinee43_1_, classtest0x0_.Tipo04 as Tipo44_1_, classtest0x0_.Tariffa04 as Tariffa45_1_, classtest0x0_.TipoLinea04 as TipoLinea46_1_, classtest0x0_.DataInizioValidita04 as DataIni47_1_, classtest0x0_.DataFineValidita04 as DataFin48_1_, classtest0x0_.CodIva04 as CodIva49_1_, classtest0x0_.Descrizione104 as Descriz50_1_, classtest0x0_.Descrizione204 as Descriz51_1_ from ClassTestTable01 classtest0x0_ order by classtest0x0_.idClassTest ASC
Any suggestion about this issue?
|