← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5856: Added link between DataElement and OptionSet

 

------------------------------------------------------------
revno: 5856
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-02-03 09:35:56 +0100
message:
  Added link between DataElement and OptionSet
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java
  dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElement.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/dataelement/DataElement.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java	2012-01-30 20:16:08 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java	2012-02-03 08:35:56 +0000
@@ -38,6 +38,7 @@
 import org.hisp.dhis.common.adapter.DataElementGroupXmlAdapter;
 import org.hisp.dhis.common.adapter.DataSetXmlAdapter;
 import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.option.OptionSet;
 import org.hisp.dhis.period.PeriodType;
 import org.hisp.dhis.period.YearlyPeriodType;
 
@@ -167,9 +168,14 @@
     private boolean zeroIsSignificant;
 
     /**
-     * Set of the dynamic attributes values that belong to this dataElement.
+     * Set of the dynamic attributes values that belong to this data element.
      */
     private Set<AttributeValue> attributeValues = new HashSet<AttributeValue>();
+    
+    /**
+     * The option set for this data element.
+     */
+    private OptionSet optionSet;
 
     // -------------------------------------------------------------------------
     // Constructors
@@ -550,4 +556,14 @@
     {
         this.attributeValues = attributeValues;
     }
+
+    public OptionSet getOptionSet()
+    {
+        return optionSet;
+    }
+
+    public void setOptionSet( OptionSet optionSet )
+    {
+        this.optionSet = optionSet;
+    }
 }

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElement.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElement.hbm.xml	2011-11-23 18:07:35 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElement.hbm.xml	2012-02-03 08:35:56 +0000
@@ -68,5 +68,8 @@
       <many-to-many class="org.hisp.dhis.attribute.AttributeValue" column="attributevalueid" unique="true" />
     </set>
 
+	<many-to-one name="optionSet" class="org.hisp.dhis.option.OptionSet" column="optionsetid"
+		foreign-key="fk_dataelement_optionsetid"/>
+
   </class>
 </hibernate-mapping>