← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3544: Added assocation DataSet - Set<Indicators>

 

------------------------------------------------------------
revno: 3544
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2011-05-09 00:34:28 +0200
message:
  Added assocation DataSet - Set<Indicators>
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java
  dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataset/hibernate/DataSet.hbm.xml


--
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/dataset/DataSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java	2011-05-05 21:14:56 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java	2011-05-08 22:34:28 +0000
@@ -35,6 +35,7 @@
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementOperand;
 import org.hisp.dhis.dataentryform.DataEntryForm;
+import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.period.PeriodType;
 
@@ -64,6 +65,12 @@
     private Collection<DataElement> dataElements = new HashSet<DataElement>();
 
     /**
+     * Indicators associated with this data set. Indicators are used for view and
+     * output purposes, such as calculated fields in forms and reports.
+     */
+    private Set<Indicator> indicators = new HashSet<Indicator>();
+    
+    /**
      * The DataElementOperands for which data must be entered in order for the
      * DataSet to be considered as complete.
      */
@@ -230,6 +237,16 @@
         this.dataElements = dataElements;
     }
 
+    public Set<Indicator> getIndicators()
+    {
+        return indicators;
+    }
+
+    public void setIndicators( Set<Indicator> indicators )
+    {
+        this.indicators = indicators;
+    }
+
     public Set<DataElementOperand> getCompulsoryDataElementOperands()
     {
         return compulsoryDataElementOperands;

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataset/hibernate/DataSet.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataset/hibernate/DataSet.hbm.xml	2011-05-02 14:48:05 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataset/hibernate/DataSet.hbm.xml	2011-05-08 22:34:28 +0000
@@ -30,6 +30,11 @@
       <key column="datasetid" foreign-key="fk_datasetmembers_datasetid" />
       <many-to-many class="org.hisp.dhis.dataelement.DataElement" column="dataelementid" foreign-key="fk_dataset_dataelementid" />
     </set>
+	
+	<set name="indicators" table="datasetindicators">
+	  <key column="datasetid" foreign-key="fk_datasetindicators_datasetid" />
+	  <many-to-many class="org.hisp.dhis.indicator.Indicator" column="indicatorid" foreign-key="fk_dataset_indicatorid" />
+	</set>
 
     <set name="compulsoryDataElementOperands" table="datasetoperands" cascade="all-delete-orphan">
       <key column="datasetid" foreign-key="fk_datasetoperands_datasetid" />