HHH-3873 DB2Dialect.getLimitString raise DB2 error message when called with limit=0

This commit is contained in:
Strong Liu 2010-10-28 16:59:37 +08:00
parent c66026e3f3
commit e9ad3bf713
2 changed files with 6 additions and 0 deletions

View File

@ -59,6 +59,9 @@ public class DB2390Dialect extends DB2Dialect {
if ( offset > 0 ) {
throw new UnsupportedOperationException( "query result offset is not supported" );
}
if ( limit == 0 ) {
return sql;
}
return new StringBuffer( sql.length() + 40 )
.append( sql )
.append( " fetch first " )

View File

@ -59,6 +59,9 @@ public class DB2400Dialect extends DB2Dialect {
if ( offset > 0 ) {
throw new UnsupportedOperationException( "query result offset is not supported" );
}
if ( limit == 0 ) {
return sql;
}
return new StringBuffer( sql.length() + 40 )
.append( sql )
.append( " fetch first " )