dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #13021
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4097: Codestyle
------------------------------------------------------------
revno: 4097
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-07-07 22:49:32 +0200
message:
Codestyle
modified:
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptionComboDeletionHandler.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementCategoryService.java
resources/sql/integritychecks.sql
--
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/dataelement/DataElementCategoryOptionComboDeletionHandler.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptionComboDeletionHandler.java 2011-06-03 13:11:34 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryOptionComboDeletionHandler.java 2011-07-07 20:49:32 +0000
@@ -83,15 +83,21 @@
@Override
public boolean allowDeleteDataElementCategoryCombo( DataElementCategoryCombo categoryCombo )
{
- for(DataElementCategoryOptionCombo eachOptionCombo : categoryCombo.getOptionCombos())
+ for ( DataElementCategoryOptionCombo eachOptionCombo : categoryCombo.getOptionCombos() )
{
String sql = "SELECT COUNT(*) FROM datavalue where categoryoptioncomboid=" + eachOptionCombo.getId();
- if( jdbcTemplate.queryForInt( sql ) > 0) return false;
+ if ( jdbcTemplate.queryForInt( sql ) > 0 )
+ {
+ return false;
+ }
sql = "SELECT COUNT(*) FROM expressionoptioncombo where categoryoptioncomboid=" + eachOptionCombo.getId();
- if( jdbcTemplate.queryForInt( sql ) > 0) return false;
+ if ( jdbcTemplate.queryForInt( sql ) > 0 )
+ {
+ return false;
+ }
}
return true;
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementCategoryService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementCategoryService.java 2011-04-12 12:15:54 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DefaultDataElementCategoryService.java 2011-07-07 20:49:32 +0000
@@ -280,8 +280,6 @@
return dataElementCategoryOptionComboStore.getByUuid( uuid );
}
-
-
public Collection<DataElementCategoryOptionCombo> getDataElementCategoryOptionCombos(
final Collection<Integer> identifiers )
{
=== modified file 'resources/sql/integritychecks.sql'
--- resources/sql/integritychecks.sql 2011-04-11 11:10:49 +0000
+++ resources/sql/integritychecks.sql 2011-07-07 20:49:32 +0000
@@ -61,6 +61,8 @@
create index aggregatedindicatorvalue_index on aggregatedindicatorvalue (indicatorid, periodid, organisationunitid);
create index aggregateddatasetcompleteness_index on aggregateddatasetcompleteness (datasetid, periodid, organisationunitid);
+select * from categoryoptioncombo where categoryoptioncomboid not in (select distinct categoryoptioncomboid from datavalue);
+
-- Get category option combos without category options
select * from categoryoptioncombo where categoryoptioncomboid not in (select distinct categoryoptioncomboid from categoryoptioncombos_categoryoptions);