=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java' --- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java 2015-02-20 13:45:23 +0000 +++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/datavalueset/DefaultDataValueSetService.java 2015-02-24 10:39:18 +0000 @@ -641,6 +641,11 @@ orgUnitMap.putAll( getOrgUnitMap( orgUnitIdScheme ) ); } + IdentifiableObjectCallable dataElementCallable = new IdentifiableObjectCallable<>( + identifiableObjectManager, DataElement.class, null ); + IdentifiableObjectCallable orgUnitCallable = new IdentifiableObjectCallable<>( + identifiableObjectManager, OrganisationUnit.class, trimToNull( dataValueSet.getOrgUnit() ) ); + //---------------------------------------------------------------------- // Get outer meta-data //---------------------------------------------------------------------- @@ -651,8 +656,7 @@ Period outerPeriod = PeriodType.getPeriodFromIsoString( trimToNull( dataValueSet.getPeriod() ) ); - OrganisationUnit outerOrgUnit = orgUnitMap.get( trimToNull( dataValueSet.getOrgUnit() ), - new IdentifiableObjectCallable<>( identifiableObjectManager, OrganisationUnit.class, trimToNull( dataValueSet.getOrgUnit() ) ) ); + OrganisationUnit outerOrgUnit = orgUnitMap.get( trimToNull( dataValueSet.getOrgUnit() ), orgUnitCallable ); DataElementCategoryOptionCombo fallbackCategoryOptionCombo = categoryService.getDefaultDataElementCategoryOptionCombo(); @@ -724,11 +728,10 @@ totalCount++; - DataElement dataElement = dataElementMap.get( trimToNull( dataValue.getDataElement() ), - new IdentifiableObjectCallable<>( identifiableObjectManager, DataElement.class, trimToNull( dataValue.getDataElement() ) ) ); + DataElement dataElement = dataElementMap.get( trimToNull( dataValue.getDataElement() ), dataElementCallable.setUid( trimToNull( dataValue.getDataElement() ) ) ); Period period = outerPeriod != null ? outerPeriod : PeriodType.getPeriodFromIsoString( trimToNull( dataValue.getPeriod() ) ); - OrganisationUnit orgUnit = outerOrgUnit != null ? outerOrgUnit : orgUnitMap.get( trimToNull( dataValue.getOrgUnit() ), - new IdentifiableObjectCallable<>( identifiableObjectManager, OrganisationUnit.class, trimToNull( dataValue.getOrgUnit() ) ) ); + OrganisationUnit orgUnit = outerOrgUnit != null ? outerOrgUnit : + orgUnitMap.get( trimToNull( dataValue.getOrgUnit() ), orgUnitCallable.setUid( trimToNull( dataValue.getOrgUnit() ) ) ); DataElementCategoryOptionCombo categoryOptionCombo = categoryOptionComboMap.get( trimToNull( dataValue.getCategoryOptionCombo() ) ); DataElementCategoryOptionCombo attrOptionCombo = outerAttrOptionCombo != null ? outerAttrOptionCombo : categoryOptionComboMap.get( trimToNull( dataValue.getAttributeOptionCombo() ) ); === modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/callable/IdentifiableObjectCallable.java' --- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/callable/IdentifiableObjectCallable.java 2015-02-19 23:24:21 +0000 +++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/callable/IdentifiableObjectCallable.java 2015-02-24 10:39:18 +0000 @@ -57,4 +57,10 @@ { return manager.get( clazz, uid ); } + + public IdentifiableObjectCallable setUid( String uid ) + { + this.uid = uid; + return this; + } }