I'm having some troubles with useLimit() in net.sf.hibernate.loader.Loader (hibernate 2.0)
The method looks like this
<snip>
private boolean useLimit(RowSelection selection, SessionImplementor session) {
Dialect d = session.getFactory().getDialect();
return d.supportsLimit() &&
( selection!=null && selection.getMaxRows()!=null ) && //there is a max rows
( d.preferLimit() || getFirstRow(selection)!=0 );
}
</snip>
My problem is that I want use setFirstResult(0), setMaxResults(100) when I retrieve the first part of a LAAARGE result set. Because of the getFirstRow(selection)!=0 expression in the implementation above a limit clause will not be added to the SQL statement.
My workaround is setFirstResult(1) but then I will not be able to retrieve one row (the first one) from the database.
Question: Am I missing something obvious here or is this a bug?
Kind Regards Fredrik Larsson
_________________________________________________________________ Lättare att hitta drömresan med MSN Resor http://www.msn.se/resor/
------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel