this( dialect );
LockMode upgradeType = null;
Iterator iter = lockModes.entrySet().iterator();
while ( iter.hasNext() ) {
final Map.Entry me = ( Map.Entry ) iter.next();
final LockMode lockMode = ( LockMode ) me.getValue();
if ( LockMode.READ.lessThan( lockMode ) ) {
final String tableAlias = ( String ) me.getKey();
if ( dialect.forUpdateOfColumns() ) {
String[] keyColumns = ( String[] ) keyColumnNames.get( tableAlias ); //use the id column alias
if ( keyColumns == null ) {
throw new IllegalArgumentException( "alias not found: " + tableAlias );
}
keyColumns = StringHelper.qualify( tableAlias, keyColumns );
for ( int i = 0; i < keyColumns.length; i++ ) {
addTableAlias( keyColumns[i] );
}
}
else {
addTableAlias( tableAlias );
}
if ( upgradeType != null && lockMode != upgradeType ) {
throw new QueryException( "mixed LockModes" );
}
upgradeType = lockMode;
}
}
if ( upgradeType == LockMode.UPGRADE_NOWAIT ) {
setNowaitEnabled( true );
}