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

This commit is contained in:
Strong Liu 2010-10-28 16:22:05 +08:00
parent f0967db638
commit ca009f5340
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 " )