t.tableBuilder( t.table( q.createQuery( innerBuilder.createExpression() ),
t.tableAlias( TABLE_NAME_PREFIX + "0" ) ) ) );
this.processOrderBySegments( orderBySegments, vendor, mainQuery );
QueryExpression finalMainQuery = this.finalizeQuery(
vendor, mainQuery, resultType, whereClause,
orderBySegments, firstResult, maxResults, variables, values, valueSQLTypes,
countOnly );
String result = vendor.toString( finalMainQuery );