StringBuilder buffer = new StringBuilder( sql );
int correction = 0;
while ( itr.hasNext() ) {
final Map.Entry entry = ( Map.Entry ) itr.next();
final LockMode lockMode = ( LockMode ) entry.getValue();
if ( lockMode.greaterThan( LockMode.READ ) ) {
final String alias = ( String ) entry.getKey();
int start = -1, end = -1;
if ( sql.endsWith( " " + alias ) ) {
start = ( sql.length() - alias.length() ) + correction;
end = start + alias.length();