← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19689: Only making necessary methods transactional in program indicator service

 

------------------------------------------------------------
revno: 19689
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2015-07-27 21:10:43 +0200
message:
  Only making necessary methods transactional in program indicator service
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramIndicatorService.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-core/src/main/java/org/hisp/dhis/program/DefaultProgramIndicatorService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramIndicatorService.java	2015-07-19 14:54:19 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/program/DefaultProgramIndicatorService.java	2015-07-27 19:10:43 +0000
@@ -61,7 +61,6 @@
 /**
  * @author Chau Thu Tran
  */
-@Transactional
 public class DefaultProgramIndicatorService
     implements ProgramIndicatorService
 {
@@ -144,54 +143,63 @@
     // -------------------------------------------------------------------------
 
     @Override
+    @Transactional
     public int addProgramIndicator( ProgramIndicator programIndicator )
     {
         return programIndicatorStore.save( programIndicator );
     }
 
     @Override
+    @Transactional
     public void updateProgramIndicator( ProgramIndicator programIndicator )
     {
         programIndicatorStore.update( programIndicator );
     }
 
     @Override
+    @Transactional
     public void deleteProgramIndicator( ProgramIndicator programIndicator )
     {
         programIndicatorStore.delete( programIndicator );
     }
 
     @Override
+    @Transactional
     public ProgramIndicator getProgramIndicator( int id )
     {
         return i18n( i18nService, programIndicatorStore.get( id ) );
     }
 
     @Override
+    @Transactional
     public ProgramIndicator getProgramIndicator( String name )
     {
         return i18n( i18nService, programIndicatorStore.getByName( name ) );
     }
 
     @Override
+    @Transactional
     public ProgramIndicator getProgramIndicatorByUid( String uid )
     {
         return i18n( i18nService, programIndicatorStore.getByUid( uid ) );
     }
 
     @Override
+    @Transactional
     public ProgramIndicator getProgramIndicatorByShortName( String shortName )
     {
         return i18n( i18nService, programIndicatorStore.getByShortName( shortName ) );
     }
 
     @Override
+    @Transactional
     public List<ProgramIndicator> getAllProgramIndicators()
     {
         return i18n( i18nService, programIndicatorStore.getAll() );
     }
 
     @Override
+    @Transactional
     public String getProgramIndicatorValue( ProgramIndicator programIndicator, ProgramInstance programInstance )
     {
         Double value = getValue( programIndicator, programInstance, null );
@@ -266,11 +274,12 @@
     }
     
     @Override
+    @Transactional
     public Map<String, String> getProgramIndicatorValues( ProgramInstance programInstance )
     {
         Map<String, String> result = new HashMap<>();
 
-        Collection<ProgramIndicator> programIndicators = new HashSet<>( programInstance.getProgram().getProgramIndicators() );
+        Set<ProgramIndicator> programIndicators = programInstance.getProgram().getProgramIndicators();
 
         for ( ProgramIndicator programIndicator : programIndicators )
         {
@@ -286,6 +295,7 @@
     }
     
     @Override
+    @Transactional
     public String getExpressionDescription( String expression )
     {
         if ( expression == null )
@@ -410,6 +420,7 @@
     }
     
     @Override
+    @Transactional
     public String expressionIsValid( String expression )
     {
         String expr = getSubstitutedExpression( expression );
@@ -428,6 +439,7 @@
     }
     
     @Override
+    @Transactional
     public String filterIsValid( String filter )
     {
         String expr = getSubstitutedExpression( filter );
@@ -520,6 +532,7 @@
     }
 
     @Override
+    @Transactional
     public Set<DataElement> getDataElementsInIndicators( Collection<ProgramIndicator> indicators )
     {
         Set<DataElement> dataElements = new HashSet<>();
@@ -538,6 +551,7 @@
     }
     
     @Override
+    @Transactional
     public Set<ProgramStageDataElement> getProgramStageDataElementsInExpression( String expression )
     {
         Set<ProgramStageDataElement> elements = new HashSet<>();
@@ -562,6 +576,7 @@
     }
 
     @Override
+    @Transactional
     public Set<TrackedEntityAttribute> getAttributesInIndicators( Collection<ProgramIndicator> indicators )
     {
         Set<TrackedEntityAttribute> attributes = new HashSet<>();
@@ -575,6 +590,7 @@
     }
     
     @Override
+    @Transactional
     public Set<TrackedEntityAttribute> getAttributesInExpression( String expression )
     {
         Set<TrackedEntityAttribute> attributes = new HashSet<>();
@@ -597,6 +613,7 @@
     }
 
     @Override
+    @Transactional
     public Set<Constant> getConstantsInIndicators( Collection<ProgramIndicator> indicators )
     {
         Set<Constant> constants = new HashSet<>();
@@ -610,6 +627,7 @@
     }
     
     @Override
+    @Transactional
     public Set<Constant> getConstantsInExpression( String expression )
     {
         Set<Constant> constants = new HashSet<>();