temporaryComputedColumns.add(new ComputedColumn( "_{$TEMP_GROUP_"+i+"$}_", src.getKeyExpression(), DataType.ANY_TYPE));
{ ;  temporaryComputedColumns.add(new ComputedColumn( "_{$TEMP_GROUP_"+i+"$}_", src.getKeyExpression(), getTempComputedColumnType( groupSpecs[i].getInterval() ))); }
		protected void populateOdiQuery( ) throws DataException		{			assert odiQuery != null;			assert queryDefn != null;						Context cx = Context.enter();			try			{				List temporaryComputedColumns = new ArrayList();								// Set grouping				List groups = queryDefn.getGroups();				if ( groups != null && ! groups.isEmpty() )				{					IQuery.GroupSpec[] groupSpecs = new IQuery.GroupSpec[ groups.size() ];					Iterator it = groups.iterator();					for ( int i = 0; it.hasNext(); i++ )					{						IGroupDefinition src = (IGroupDefinition) it.next();						//TODO does the index of column significant?						IQuery.GroupSpec dest = groupDefnToSpec(cx, src,"_{$TEMP_GROUP_"+i+"$}_", -1 );						groupSpecs[i] = dest;												if( groupSpecs[i].isCompleteExpression() )							temporaryComputedColumns.add(new ComputedColumn( "_{$TEMP_GROUP_"+i+"$}_", src.getKeyExpression(), DataType.ANY_TYPE));					}					odiQuery.setGrouping( Arrays.asList( groupSpecs));				}						// Set sorting				List sorts = queryDefn.getSorts();				if ( sorts != null && !sorts.isEmpty( ) )				{					IQuery.SortSpec[] sortSpecs = new IQuery.SortSpec[ sorts.size() ];					Iterator it = sorts.iterator();					for ( int i = 0; it.hasNext(); i++ )					{						ISortDefinition src = (ISortDefinition) it.next();						int sortIndex = -1;						String sortKey = src.getColumn();						if ( sortKey == null || sortKey.length() == 0 )						{ 							//Firstly try to treat sort key as a column reference expression							ColumnInfo columnInfo = getColInfoFromJSExpr( cx,									src.getExpression( ).getText() );																					sortIndex = columnInfo.getColumnIndex(); 							sortKey = columnInfo.getColumnName( );						}						if ( sortKey == null && sortIndex < 0 )						{							//If failed to treate sort key as a column reference expression							//then treat it as a computed column expression							temporaryComputedColumns.add(new ComputedColumn( "_{$TEMP_SORT_"+i+"$}_", src.getExpression().getText(), DataType.ANY_TYPE));							sortIndex = -1; 							sortKey = String.valueOf("_{$TEMP_SORT_"+i+"$}_");						}												IQuery.SortSpec dest = new IQuery.SortSpec( sortIndex,								sortKey,								src.getSortDirection( ) == ISortDefinition.SORT_ASC );						sortSpecs[i] = dest;					}					odiQuery.setOrdering( Arrays.asList( sortSpecs));				}								List computedColumns = null;			    // set computed column event				computedColumns = this.dataSet.getComputedColumns( );				if ( computedColumns != null )				{					computedColumns.addAll( temporaryComputedColumns );				}				if ( (computedColumns != null && computedColumns.size() > 0)|| temporaryComputedColumns.size( ) > 0 )				{					IResultObjectEvent objectEvent = new ComputedColumnHelper( this.dataSet,							(computedColumns == null&&computedColumns.size()>0) ? temporaryComputedColumns : computedColumns );					odiQuery.addOnFetchEvent( objectEvent );				}		    	if ( dataSet.getEventHandler() != null )		    	{		    		OnFetchScriptHelper event = new OnFetchScriptHelper( dataSet ); 		    		odiQuery.addOnFetchEvent( event );			    }			    			    // set filter event			    List mergedFilters = new ArrayList( );			    			    if ( dataSet.getFilters( ) != null )				{					mergedFilters.addAll( dataSet.getFilters( ) );				}			    			    if ( queryDefn.getFilters( ) != null )				{					mergedFilters.addAll( queryDefn.getFilters( ) );				}			   		   			    			    if ( mergedFilters.size() > 0 )			    {			    	IResultObjectEvent objectEvent = new FilterByRow( mergedFilters, 			    			dataSet );			    	odiQuery.addOnFetchEvent( objectEvent );			    }			    				// specify max rows the query should fetch			    odiQuery.setMaxRows( queryDefn.getMaxRows() );			}			finally			{				Context.exit();			}		}