StringHelper.getFirstNonWhitespaceCharacter( afterPlaceholder ) == ')';
if ( vals.size() == 1 && isEnclosedInParens ) {
// short-circuit for performance when only 1 value and the
// placeholder is already enclosed in parentheses...
namedParamsCopy.put( name, new TypedValue( type, vals.iterator().next() ) );
return query;
}
StringBuilder list = new StringBuilder( 16 );
Iterator iter = vals.iterator();
int i = 0;
while ( iter.hasNext() ) {
// Variable 'name' can represent a number or contain digit at the end. Surrounding it with
// characters to avoid ambiguous definition after concatenating value of 'i' counter.
String alias = ( isJpaPositionalParam ? 'x' + name : name ) + '_' + i++ + '_';
if ( namedParamsCopy.put( alias, new TypedValue( type, iter.next() ) ) != null ) {
throw new HibernateException( "Repeated usage of alias '" + alias + "' while expanding list parameter." );
}
list.append( ParserHelper.HQL_VARIABLE_PREFIX ).append( alias );
if ( iter.hasNext() ) {
list.append( ", " );