private int bindLimitParameters(
final PreparedStatement statement,
final int index,
final RowSelection selection) throws SQLException {
Dialect dialect = getFactory().getDialect();
if ( !dialect.supportsVariableLimit() ) {
return 0;
}
if ( !hasMaxRows( selection ) ) {
throw new AssertionFailure( "no max results set" );
}