Bug 350763 User-defined Sort Hints in a data set got overwritten in a SQB design session
When editing a data set in the Data Set Editor, an user may add own user-defined Sort Hints. But each time an user activates the SQB designer page in DSE, those sort hints always got overwritten and replaced by the sort keys defined in the query's OrderBy clause. This is expected behavior if the OrderBy clause gets changed, as it is not clear how a revised OrderBy clause relates to those user-defined sort hints. However, if the OrderBy clause did not get changed, the previously defined sort hints should be preserved.
data/org.eclipse.birt.report.data.oda.jdbc.dbprofile.ui/src/org/eclipse/birt/report/data/oda/jdbc/dbprofile/ui/internal/sqb/SQLQueryUtility.java
import org.eclipse.datatools.modelbase.sql.query.OrderingSpecType;
import org.eclipse.datatools.modelbase.sql.query.QueryExpressionBody;
import org.eclipse.datatools.modelbase.sql.query.QueryExpressionRoot;
import org.eclipse.datatools.modelbase.sql.query.QuerySelectStatement;
import org.eclipse.datatools.modelbase.sql.query.QueryStatement;
import org.eclipse.datatools.modelbase.sql.query.QueryValueExpression;
import org.eclipse.datatools.modelbase.sql.query.ResultColumn;
import org.eclipse.datatools.modelbase.sql.query.ValueExpressionColumn;
import org.eclipse.datatools.modelbase.sql.query.ValueExpressionVariable;
import org.eclipse.datatools.modelbase.sql.query.helper.StatementHelper;
import org.eclipse.datatools.modelbase.sql.query.helper.TableHelper;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.PlatformUI;
/**
 * An internal utility class to process the metadata of a SQL query statement.
 */
public class SQLQueryUtility
{
	private static final String EMPTY_STRING = ""; $NON-NLS-1$
	private static final String PROP_PRIVATE_PARAMETERMETADATA = DBProfileStatement.PROP_PRIVATE_PARAMETERMETADATA;
	private static final String CONST_PARAMS_DELIMITER = DBProfileStatement.CONST_PARAMS_DELIMITER;
	private static final String CONST_PARAM_NAME_DELIMITER = DBProfileStatement.CONST_PARAM_NAME_DELIMITER;
	private static final String CLASS_NAME = SQLQueryUtility.class.getName();
    static void updateDataSetDesign( DataSetDesign dataSetDesign, 
            final QueryStatement queryStmt, IConnectionProfile connProfile, final DataSetDesign origDataSetDesign )
    {
        String dataSetName = origDataSetDesign.getName();
    	if ( dataSetName != null )
    		dataSetDesign.setName( dataSetName );