return new PreparedDummyQuery( queryDefn, dataEngine.getSharedScope( ) );
if ( queryDefn.getQueryResultsID( ) == null ) return new PreparedDummyQuery( queryDefn, dataEngine.getSharedScope( ) ); else return new PreparedIVQuery( dataEngine, queryDefn );
	static IPreparedQuery newInstance( DataEngineImpl dataEngine,			IQueryDefinition queryDefn, Map appContext ) throws DataException	{		assert dataEngine != null;		assert queryDefn != null;				IBaseDataSetDesign dset = dataEngine.getDataSetDesign( queryDefn.getDataSetName( ) );		if ( dset == null )		{			// In new column binding feature, when ther is no data set,			// it is indicated that a dummy data set needs to be created			// internally. But using the dummy one, the binding expression only			// can refer to row object and no other object can be refered such			// as rows.			return new PreparedDummyQuery( queryDefn,					dataEngine.getSharedScope( ) );		}		PreparedDataSourceQuery preparedQuery;				if ( dset instanceof IScriptDataSetDesign )		{			preparedQuery = new PreparedScriptDSQuery( dataEngine,					queryDefn,					dset, appContext );		}		else if ( dset instanceof IOdaDataSetDesign )		{			preparedQuery = new PreparedOdaDSQuery( dataEngine,					queryDefn,					dset,					appContext );		}		else if ( dset instanceof IJointDataSetDesign )		{			preparedQuery = new PreparedJointDataSourceQuery( dataEngine, queryDefn, dset, appContext );		}		else		{			DataException e = new DataException( ResourceConstants.UNSUPPORTED_DATASET_TYPE,					dset.getName( ) );			logger.logp( Level.FINE,					PreparedDataSourceQuery.class.getName( ),					"newInstance",					"Unsupported data source type",					e );			throw e;		}		return preparedQuery;	}