=== 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 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 getProgramIndicatorValues( ProgramInstance programInstance ) { Map result = new HashMap<>(); - Collection programIndicators = new HashSet<>( programInstance.getProgram().getProgramIndicators() ); + Set 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 getDataElementsInIndicators( Collection indicators ) { Set dataElements = new HashSet<>(); @@ -538,6 +551,7 @@ } @Override + @Transactional public Set getProgramStageDataElementsInExpression( String expression ) { Set elements = new HashSet<>(); @@ -562,6 +576,7 @@ } @Override + @Transactional public Set getAttributesInIndicators( Collection indicators ) { Set attributes = new HashSet<>(); @@ -575,6 +590,7 @@ } @Override + @Transactional public Set getAttributesInExpression( String expression ) { Set attributes = new HashSet<>(); @@ -597,6 +613,7 @@ } @Override + @Transactional public Set getConstantsInIndicators( Collection indicators ) { Set constants = new HashSet<>(); @@ -610,6 +627,7 @@ } @Override + @Transactional public Set getConstantsInExpression( String expression ) { Set constants = new HashSet<>();