← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 17619: minor fix, in bridge, check to see if object have unique code/name

 

------------------------------------------------------------
revno: 17619
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2014-11-30 13:08:12 +0700
message:
  minor fix, in bridge, check to see if object have unique code/name
modified:
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultObjectBridge.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-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultObjectBridge.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultObjectBridge.java	2014-11-29 12:20:13 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/metadata/DefaultObjectBridge.java	2014-11-30 06:08:12 +0000
@@ -602,7 +602,7 @@
             map = codeMap.get( identifiableObject.getClass() );
         }
 
-        if ( !preheatCache && entity == null )
+        if ( !preheatCache && entity == null && identifiableObject.haveUniqueCode() )
         {
             entity = manager.getByCode( identifiableObject.getClass(), identifiableObject.getCode() );
 
@@ -630,7 +630,7 @@
             map = nameMap.get( identifiableObject.getClass() );
         }
 
-        if ( !preheatCache && identifiableObject.haveUniqueNames() && entity == null )
+        if ( !preheatCache && entity == null && identifiableObject.haveUniqueNames() )
         {
             entity = manager.getByName( identifiableObject.getClass(), identifiableObject.getName() );