← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21805: remove mapping of Attribute.attributeValues, not used anywhere and also causes issues with recurs...

 

------------------------------------------------------------
revno: 21805
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2016-01-25 12:47:49 +0700
message:
  remove mapping of Attribute.attributeValues, not used anywhere and also causes issues with recursion when doing exports (Attribute <=> AttributeValues <=> Attribute <=> ...)
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/Attribute.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseIdentifiableObject.java
  dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/attribute/hibernate/Attribute.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/attribute/Attribute.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/Attribute.java	2016-01-04 02:27:49 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/Attribute.java	2016-01-25 05:47:49 +0000
@@ -154,7 +154,9 @@
         {
             return false;
         }
+
         final Attribute other = (Attribute) obj;
+
         return Objects.equals( this.valueType, other.valueType )
             && Objects.equals( this.dataElementAttribute, other.dataElementAttribute )
             && Objects.equals( this.dataElementGroupAttribute, other.dataElementGroupAttribute )
@@ -490,6 +492,8 @@
         this.sortOrder = sortOrder;
     }
 
+
+
     public List<Class<? extends IdentifiableObject>> getSupportedClasses()
     {
         List<Class<? extends IdentifiableObject>> klasses = new ArrayList<>();
@@ -517,7 +521,6 @@
         return klasses;
     }
 
-
     @Override
     public void mergeWith( IdentifiableObject other, MergeStrategy strategy )
     {

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseIdentifiableObject.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseIdentifiableObject.java	2016-01-04 02:27:49 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseIdentifiableObject.java	2016-01-25 05:47:49 +0000
@@ -279,6 +279,7 @@
         this.lastUpdated = lastUpdated;
     }
 
+    @Override
     @JsonProperty( "attributeValues" )
     @JsonView( { DetailedView.class, ExportView.class } )
     @JacksonXmlElementWrapper( localName = "attributeValues", namespace = DxfNamespaces.DXF_2_0 )

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/attribute/hibernate/Attribute.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/attribute/hibernate/Attribute.hbm.xml	2015-12-17 13:36:30 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/attribute/hibernate/Attribute.hbm.xml	2016-01-25 05:47:49 +0000
@@ -69,11 +69,14 @@
 
     <property name="sortOrder" />
 
+    <!-- commented out for now, not sure if we really need this mapping.
+      It also causes issues with recursion Attribute <=> AttributeValues <=> Attribute
     <set name="attributeValues" inverse="true" lazy="true">
       <cache usage="read-write" />
       <key column="attributeid" />
       <one-to-many class="AttributeValue" />
     </set>
+    -->
 
     <many-to-one name="optionSet" class="org.hisp.dhis.option.OptionSet" column="optionsetid"
       foreign-key="fk_attribute_optionsetid" />