Bug 319902 Internal API Usage of the ODA framework components
data/org.eclipse.birt.report.data.oda.jdbc.dbprofile.ui/src/org/eclipse/birt/report/data/oda/jdbc/dbprofile/ui/internal/sqb/SQLQueryUtility.java
ResultSetColumns columns = DesignSessionUtil.toResultSetColumnsDesign( md );
        ResultSetDefinition resultSetDefn = DesignFactory.eINSTANCE
                .createResultSetDefinition();
        
        resultSetDefn.setResultSetColumns( columns );
        
        dataSetDesign.setPrimaryResultSet( resultSetDefn );
        dataSetDesign.getResultSets().setDerivedMetaData( true );
        try
        {
            updateResultSetCriteria( resultSetDefn, queryStmt );
        }
        catch( OdaException ex )
        {
            
        }
    }
    
    @SuppressWarnings("unchecked")
    private static void updateResultSetCriteria( ResultSetDefinition resultSetDefn, 
            final QueryStatement queryStmt )
        throws OdaException
    {
        if( ! (queryStmt instanceof QuerySelectStatement) )
            throw new OdaException( new IllegalStateException(  
                    Messages.bind( "Invalid QuerySelectStatement argument in {0}#updateResultSetCriteria", $NON-NLS-1$
                            CLASS_NAME )));
        
        ResultSetCriteria criteria = DesignFactory.eINSTANCE.createResultSetCriteria();
        criteria.setRowOrdering( DesignFactory.eINSTANCE.createSortSpecification() );