GroupDefinition[] subGroupDefn = new GroupDefinition[]{ new GroupDefinition( "group2" ) }; subGroupDefn[0].setKeyExpression( "row.col2" ); for ( int i = 0; i < subGroupDefn.length; i++ ) { subqueryDefn.addGroup( subGroupDefn[i] );
String[] bindingNameGroup = new String[1]; bindingNameGroup[0] = "GROUP_COL2"; IBaseExpression[] bindingExprGroup = new IBaseExpression[1]; bindingExprGroup[0] = new ScriptExpression("dataSetRow.COL2"); GroupDefinition[] subGroupDefn = new GroupDefinition[] { new GroupDefinition( "group2") };  subGroupDefn[0].setKeyExpression( "row.GROUP_COL2" );  for (int k = 0; k < subGroupDefn.length; k++) { if (bindingNameGroup != null) for (int i = 0; i < bindingNameGroup.length; i++) subqueryDefn.addResultSetExpression( bindingNameGroup[i], bindingExprGroup[i]);  for (int i = 0; i < subGroupDefn.length; i++) subqueryDefn.addGroup(subGroupDefn[i]);
		protected IQueryDefinition getDefaultQueryDefnWithSubQuery( String dataSetName )		{			IQueryDefinition queryDefn = getDefaultQueryDefn( dataSetName );						// row.Col1			GroupDefinition groupDefn = (GroupDefinition) queryDefn.getGroups().get(1);						// ---------- begin sub query ----------			SubqueryDefinition subqueryDefn = new SubqueryDefinition( "IAMTEST" );			groupDefn.addSubquery( subqueryDefn );						GroupDefinition[] subGroupDefn = new GroupDefinition[]{				new GroupDefinition( "group2" )			};			subGroupDefn[0].setKeyExpression( "row.col2" );					for ( int i = 0; i < subGroupDefn.length; i++ )			{				subqueryDefn.addGroup( subGroupDefn[i] );			}							// --- sub query of sub query				SubqueryDefinition subSubqueryDefn = new SubqueryDefinition( "IAMTEST2" );				subGroupDefn[0].addSubquery( subSubqueryDefn );								GroupDefinition[] subSubGroupDefn = new GroupDefinition[]{					new GroupDefinition("group3")				};				subSubGroupDefn[0].setKeyExpression( "row.col3" );							for ( int i = 0; i < subSubGroupDefn.length; i++ )				{					subSubqueryDefn.addGroup( subSubGroupDefn[i] );				}							// --- sub query of sub query						// ---------- end sub query ----------						return queryDefn;		}