if ( setDesign.getParameters( ) == null ) { if ( designerValues != null ) designerValues.setDataSetParameters( null ); } else { EList designDefns = setDesign.getParameters( ) .getParameterDefinitions( );  List resultList = DataSetParameterAdapter.getDriverDefinedParameters( designDefns, userDefinedList );  if ( resultList.size( ) > 0 ) { if ( designerValues == null ) { designerValues = ModelFactory.eINSTANCE .createDesignValues( ); } DataSetParameters dsParams = designerValues.getDataSetParameters( ); if ( dsParams == null ) { dsParams = DesignFactory.eINSTANCE.createDataSetParameters( ); designerValues.setDataSetParameters( dsParams ); } dsParams = designerValues.getDataSetParameters( ); dsParams.getParameterDefinitions( ).clear( ); dsParams.getParameterDefinitions( ).addAll( resultList ); } }    try { if ( designerValues != null ) { String dValue = SerializerImpl.instance( ).write( designerValues ); setHandle.setDesignerValues( dValue ); } } catch ( IOException e ) { }
	public void updateDataSetHandle( DataSetDesign setDesign,			OdaDataSetHandle setHandle, boolean isSourceChanged )			throws SemanticException	{		if ( setDesign == null || setHandle == null )			return;		DesignUtil.validateObject( setDesign );		CommandStack stack = setHandle.getModuleHandle( ).getCommandStack( );		stack.startTrans( null );		try		{			// extension id is set without undo/redo support.			setHandle.getElement( ).setProperty(					OdaDataSourceHandle.EXTENSION_ID_PROP,					setDesign.getOdaExtensionDataSetId( ) );			setHandle.setName( setDesign.getName( ) );			setHandle.setDisplayName( setDesign.getDisplayName( ) );			// set public properties.			Properties props = setDesign.getPublicProperties( );			if ( props != null )			{				EList propList = props.getProperties( );				for ( int i = 0; i < propList.size( ); i++ )				{					Property prop = (Property) propList.get( i );					setHandle.setProperty( prop.getName( ), prop.getValue( ) );				}			}			// set private properties.			props = setDesign.getPrivateProperties( );			if ( props != null )			{				EList propList = props.getProperties( );				for ( int i = 0; i < propList.size( ); i++ )				{					Property prop = (Property) propList.get( i );					setHandle.setPrivateDriverProperty( prop.getName( ), prop							.getValue( ) );				}			}			DesignValues designerValues = null;			try			{				designerValues = SerializerImpl.instance( ).read(						setHandle.getDesignerValues( ) );			}			catch ( IOException e )			{			}			ResultSets cachedResultSets = designerValues == null					? null					: designerValues.getResultSets( );			ResultSetDefinition cachedResultDefn = null;			if ( cachedResultSets != null					&& !cachedResultSets.getResultSetDefinitions( ).isEmpty( ) )				cachedResultDefn = (ResultSetDefinition) cachedResultSets						.getResultSetDefinitions( ).get( 0 );			updateROMResultSets( setHandle, new ResultSetsAdapter( )					.newROMResultSets( setDesign, setHandle, cachedResultDefn ) );			setHandle.setResultSetName( setDesign.getPrimaryResultSetName( ) );			setHandle.setQueryText( setDesign.getQueryText( ) );			// designer values must be saved after convert data set parameters			// and result set columns.			// Set Parameter						// Get user-defined parameters			List userDefinedList = new DataSetParameterAdapter( )					.getUserDefinedParameter( designerValues, setDesign,							setHandle );			// update designvalues.						if ( setDesign.getParameters( ) == null )			{				if ( designerValues != null )					designerValues.setDataSetParameters( null );			}			else			{				EList designDefns = setDesign.getParameters( )						.getParameterDefinitions( );								List resultList = DataSetParameterAdapter.getDriverDefinedParameters(						designDefns, userDefinedList );				if ( resultList.size( ) > 0 )				{					if ( designerValues == null )					{						designerValues = ModelFactory.eINSTANCE								.createDesignValues( );					}					DataSetParameters dsParams = designerValues.getDataSetParameters( );					if ( dsParams == null )					{						dsParams = DesignFactory.eINSTANCE.createDataSetParameters( );						designerValues.setDataSetParameters( dsParams );					}					dsParams = designerValues.getDataSetParameters( );					dsParams.getParameterDefinitions( ).clear( );					dsParams.getParameterDefinitions( ).addAll( resultList );				}			}			// Set DesignerValues			try			{				if ( designerValues != null )				{					String dValue = SerializerImpl.instance( ).write(							designerValues );					setHandle.setDesignerValues( dValue );				}			}			catch ( IOException e )			{			}						//Update parameters of dataset handle.			updateROMDataSetParams( setDesign, setHandle,					userDefinedList );			DataSourceDesign sourceDesign = setDesign.getDataSourceDesign( );			if ( sourceDesign != null )			{				OdaDataSourceHandle sourceHandle = (OdaDataSourceHandle) setHandle						.getDataSource( );				// only the local data source can be used.				if ( isSourceChanged && sourceHandle != null						&& !sourceHandle.getModuleHandle( ).isReadOnly( ) )				{					setHandle.setDataSource( sourceDesign.getName( ) );					updateDataSourceHandle( sourceDesign, sourceHandle );				}				// if the source is not changed, and it is not in the included				// library, then we can update it.				if ( !isSourceChanged						&& sourceHandle != null						&& !sourceHandle.getModuleHandle( ).isReadOnly( )						&& !( new EcoreUtil.EqualityHelper( ).equals(								createDataSourceDesign( sourceHandle ),								sourceDesign ) ) )				{					updateDataSourceHandle( sourceDesign, sourceHandle );				}			}			else				setHandle.setDataSource( null );		}		catch ( SemanticException e )		{			stack.rollback( );			throw e;		}		stack.commit( );	}