Pull-request for HHH-3961

This commit is contained in:
Guenther Demetz 2012-05-02 11:00:34 +03:00 committed by Strong Liu
parent 606752f867
commit d81f65715b
1 changed files with 10 additions and 0 deletions

View File

@ -27,6 +27,7 @@ import java.sql.Types;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.hibernate.LockMode;
import org.hibernate.dialect.function.NoArgSQLFunction;
import org.hibernate.type.StandardBasicTypes;
@ -196,4 +197,13 @@ public class SQLServer2005Dialect extends SQLServerDialect {
// Insert after the select statement the row_number() function:
sql.insert( selectEndIndex - 1, ", ROW_NUMBER() OVER (" + orderby + ") as __hibernate_row_nr__" );
}
@Override // since SQLServer2005 the nowait hint is supported
public String appendLockHint(LockMode mode, String tableName) {
if ( mode == LockMode.UPGRADE_NOWAIT )
{
return tableName + " with (updlock, rowlock, nowait)";
}
return super.appendLockHint(mode, tableName);
}
}