query = new SubqueryDefinition( name );
query = new SubqueryDefinition( name, getParentQuery( ) );
		protected BaseQueryDefinition createSubQuery( ReportItemDesign item )		{			BaseQueryDefinition query = null;			IBaseTransform parentQuery = getTransform( );			// sub query must be defined in a transform			if ( parentQuery == null )			{				// no parent query exits, so create a empty query for it.				query = new QueryDefinition( getParentQuery( ) );				this.queryIDs.put( query, String.valueOf( item.getID( ) ) );				this.queries.add( query );					registerQueryAndElement( query, item );			}			else			{				// create a sub query				String name = String.valueOf( item.getID( ) );				query = new SubqueryDefinition( name );				parentQuery.getSubqueries( ).add( query );								this.queryIDs.put( query, String.valueOf( item.getID( ) ) );				registerQueryAndElement( query, item );								String currentCondition = getCurrentCondition( );								if ( currentCondition.equals( String.valueOf( true ) ) )				{					( (SubqueryDefinition)query ).setApplyOnGroupFlag( true );				}				else				{					( (SubqueryDefinition)query ).setApplyOnGroupFlag( false );				}			}						// set max rows			query.setMaxRows( maxRows );			item.setQuery( query );			if ( item.getHandle( ) instanceof ReportItemHandle )			{				ReportItemHandle designHandle = (ReportItemHandle) item						.getHandle( );				Iterator iter = designHandle.columnBindingsIterator( );				while ( iter.hasNext( ) )				{					ComputedColumnHandle binding = (ComputedColumnHandle) iter							.next( );					addColumBinding( query, binding );				}			}			addSortAndFilter( item, query );						ResultMetaData metaData = new ResultMetaData( query );			resultMetaData.put( query, metaData );					return query;		}