← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3497: Removed Indicator-IndicatorGroupSet association

 

------------------------------------------------------------
revno: 3497
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2011-04-30 12:05:14 +0200
message:
  Removed Indicator-IndicatorGroupSet association
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java
  dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/indicator/hibernate/Indicator.hbm.xml
  dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/indicator/IndicatorStoreTest.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java	2011-04-01 09:57:53 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/indicator/Indicator.java	2011-04-30 10:05:14 +0000
@@ -27,10 +27,8 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashSet;
-import java.util.List;
 import java.util.Set;
 
 import org.hisp.dhis.common.AbstractNameableObject;
@@ -70,8 +68,6 @@
     
     private Set<IndicatorGroup> groups =  new HashSet<IndicatorGroup>();
     
-    private List<IndicatorGroupSet> groupSets = new ArrayList<IndicatorGroupSet>();
-    
     // -------------------------------------------------------------------------
     // Logic
     // -------------------------------------------------------------------------
@@ -263,14 +259,4 @@
     {
         this.groups = groups;
     }
-
-    public List<IndicatorGroupSet> getGroupSets()
-    {
-        return groupSets;
-    }
-
-    public void setGroupSets( List<IndicatorGroupSet> groupSets )
-    {
-        this.groupSets = groupSets;
-    }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/indicator/hibernate/Indicator.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/indicator/hibernate/Indicator.hbm.xml	2011-04-30 09:28:32 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/indicator/hibernate/Indicator.hbm.xml	2011-04-30 10:05:14 +0000
@@ -63,12 +63,5 @@
       <many-to-many class="org.hisp.dhis.indicator.IndicatorGroup" column="indicatorgroupid" />
     </set>
 
-    <list name="groupSets" table="indicator_indicatorgroupsetmembers">
-      <key column="indicatorid" />
-      <list-index column="sort_order" base="0" />
-      <many-to-many class="org.hisp.dhis.indicator.IndicatorGroupSet" column="indicatorgroupsetid"
-        foreign-key="fk_indicator_indicatorgroupsetid" />
-    </list>
-
   </class>
 </hibernate-mapping>

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/indicator/IndicatorStoreTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/indicator/IndicatorStoreTest.java	2011-02-15 20:14:22 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/indicator/IndicatorStoreTest.java	2011-04-30 10:05:14 +0000
@@ -391,37 +391,5 @@
         
         Indicator indicatorC = indicatorStore.getIndicatorByShortName( "IndicatorShortC" );
         assertNull( indicatorC );
-    }    
-
-    @Test
-    public void testGetIndicatorsWithGroupSets()
-        throws Exception
-    {
-        IndicatorGroupSet groupSetA = createIndicatorGroupSet( 'A' );
-        
-        indicatorService.addIndicatorGroupSet( groupSetA );
-        
-        IndicatorType type = new IndicatorType( "IndicatorType", 100, false );
-
-        indicatorTypeStore.save( type );
-        
-        Indicator indicatorA = createIndicator( 'A', type );
-        Indicator indicatorB = createIndicator( 'B', type );
-        Indicator indicatorC = createIndicator( 'C', type );
-        Indicator indicatorD = createIndicator( 'D', type );
-    
-        indicatorB.getGroupSets().add( groupSetA );
-        indicatorD.getGroupSets().add( groupSetA );        
-        
-        indicatorStore.addIndicator( indicatorA );
-        indicatorStore.addIndicator( indicatorB );
-        indicatorStore.addIndicator( indicatorC );
-        indicatorStore.addIndicator( indicatorD );
-        
-        Collection<Indicator> indicators = indicatorStore.getIndicatorsWithGroupSets();
-        
-        assertEquals( 2, indicators.size() );
-        assertTrue( indicators.contains( indicatorB ) );
-        assertTrue( indicators.contains( indicatorD ) );
     }
 }