Boolean topLevel = collectionPath.equals( DBNames.QNAME_TABLE_COLLECTION_PATH_TOP_LEVEL_NAME );
String collTable = TABLE_NAME_PREFIX + currentTableIndex;
String collCol = DBNames.QNAME_TABLE_COLLECTION_PATH_COLUMN_NAME;
ColumnReferenceByName collColExp = c.colName( collTable, collCol );
BooleanBuilder collectionCondition = b.booleanBuilder();
if( topLevel && negationActive )
{
afterWhere
.and( b
.booleanBuilder(
b.neq( collColExp,
l.s( DBNames.QNAME_TABLE_COLLECTION_PATH_TOP_LEVEL_NAME ) ) )
.or( b.isNull( collColExp ) ).createExpression() );
}
Integer totalItemsProcessed = 0;
for( Object item : (Collection<?>) value )
{
String path = collectionPath + DBNames.QNAME_TABLE_COLLECTION_PATH_SEPARATOR
+ ( collectionIsSet ? "*{1,}" : collectionIndex );
Boolean isCollection = ( item instanceof Collection<?> );
BooleanBuilder newWhere = b.booleanBuilder();
if( !isCollection )
{
newWhere.reset( b.regexp( collColExp, l.s( path ) ) );
}
totalItemsProcessed
= totalItemsProcessed
+ modifyFromClauseAndWhereClauseToGetValue( qName, item, predicate,
negationActive,
currentTableIndex, maxTableIndex, columnName, path, vendor,
newWhere, afterWhere, fromClause,
groupBy, having, qNameJoins, variables, values, valueSQLTypes );
++collectionIndex;
collectionCondition.or( newWhere.createExpression() );
}
result = totalItemsProcessed;
if( topLevel )
{