dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #02010
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 666: Performance improvement in mapping service.
------------------------------------------------------------
revno: 666
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Thu 2009-09-10 19:04:18 +0200
message:
Performance improvement in mapping service.
modified:
dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/DefaultMappingService.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-mapping/src/main/java/org/hisp/dhis/mapping/DefaultMappingService.java'
--- dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/DefaultMappingService.java 2009-09-08 20:33:48 +0000
+++ dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/DefaultMappingService.java 2009-09-10 17:04:18 +0000
@@ -252,6 +252,8 @@
{
String[] rels = relations.split( RELATION_SEPARATOR );
+ Map map = getMapByMapLayerPath( mapLayerPath );
+
relationsLoop : for ( int i = 0; i < rels.length; i++ )
{
String[] rel = rels[i].split( PAIR_SEPARATOR );
@@ -270,7 +272,7 @@
continue relationsLoop;
}
- addOrUpdateMapOrganisationUnitRelation( mapLayerPath, Integer.parseInt( rel[0] ), rel[1] );
+ addOrUpdateMapOrganisationUnitRelation( map, Integer.parseInt( rel[0] ), rel[1] );
}
}
@@ -292,7 +294,12 @@
public void addOrUpdateMapOrganisationUnitRelation( String mapLayerPath, int organisationUnitId, String featureId )
{
Map map = getMapByMapLayerPath( mapLayerPath );
-
+
+ addOrUpdateMapOrganisationUnitRelation( map, organisationUnitId, featureId );
+ }
+
+ private void addOrUpdateMapOrganisationUnitRelation( Map map, int organisationUnitId, String featureId )
+ {
OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( organisationUnitId );
MapOrganisationUnitRelation mapOrganisationUnitRelation = getMapOrganisationUnitRelation( map, organisationUnit );