dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #22042
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10565: Sql view, consistent naming of methods
------------------------------------------------------------
revno: 10565
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-04-15 19:38:55 +0200
message:
Sql view, consistent naming of methods
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlViewExpandStore.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlViewService.java
dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataarchive/ArchivedDataValueDeletionHandler.java
dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataarchive/jdbc/JdbcDataArchiveStore.java
dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/sqlview/DefaultSqlViewService.java
dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/sqlview/jdbc/JdbcSqlViewExpandStore.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/sqlview/CheckViewTableExistenceAction.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-api/src/main/java/org/hisp/dhis/sqlview/SqlViewExpandStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlViewExpandStore.java 2013-04-15 17:17:31 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlViewExpandStore.java 2013-04-15 17:38:55 +0000
@@ -12,9 +12,9 @@
{
String ID = SqlViewExpandStore.class.getName();
- boolean isViewTableExists( String viewTableName );
+ boolean viewTableExists( String viewTableName );
- String createView( SqlView sqlViewInstance );
+ String createViewTable( SqlView sqlViewInstance );
void dropViewTable( String sqlViewName );
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlViewService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlViewService.java 2013-03-29 11:56:00 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/sqlview/SqlViewService.java 2013-04-15 17:38:55 +0000
@@ -70,7 +70,7 @@
// SqlView Expanded
// -------------------------------------------------------------------------
- boolean isViewTableExists( String viewTableName );
+ boolean viewTableExists( String viewTableName );
boolean createAllViewTables();
=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataarchive/ArchivedDataValueDeletionHandler.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataarchive/ArchivedDataValueDeletionHandler.java 2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataarchive/ArchivedDataValueDeletionHandler.java 2013-04-15 17:38:55 +0000
@@ -65,7 +65,7 @@
{
String sql = "SELECT COUNT(*) FROM datavaluearchive where dataelementid=" + dataElement.getId();
- return jdbcTemplate.queryForInt( sql ) == 0 ? null : ERROR;
+ return jdbcTemplate.queryForObject( sql, Integer.class ) == 0 ? null : ERROR;
}
@Override
@@ -73,7 +73,7 @@
{
String sql = "SELECT COUNT(*) FROM datavaluearchive where periodid=" + period.getId();
- return jdbcTemplate.queryForInt( sql ) == 0 ? null : ERROR;
+ return jdbcTemplate.queryForObject( sql, Integer.class ) == 0 ? null : ERROR;
}
@Override
@@ -81,7 +81,7 @@
{
String sql = "SELECT COUNT(*) FROM datavaluearchive where sourceid=" + unit.getId();
- return jdbcTemplate.queryForInt( sql ) == 0 ? null : ERROR;
+ return jdbcTemplate.queryForObject( sql, Integer.class ) == 0 ? null : ERROR;
}
@Override
@@ -89,6 +89,6 @@
{
String sql = "SELECT COUNT(*) FROM datavaluearchive where categoryoptioncomboid=" + combo.getId();
- return jdbcTemplate.queryForInt( sql ) == 0 ? null : ERROR;
+ return jdbcTemplate.queryForObject( sql, Integer.class ) == 0 ? null : ERROR;
}
}
=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataarchive/jdbc/JdbcDataArchiveStore.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataarchive/jdbc/JdbcDataArchiveStore.java 2012-07-30 11:53:35 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/dataarchive/jdbc/JdbcDataArchiveStore.java 2013-04-15 17:38:55 +0000
@@ -120,7 +120,7 @@
log.info( sql );
- return jdbcTemplate.queryForInt( sql );
+ return jdbcTemplate.queryForObject( sql, Integer.class );
}
public int getNumberOfArchivedValues()
@@ -128,7 +128,7 @@
String sql = "SELECT COUNT(*) as dem FROM datavaluearchive;";
log.info( sql );
- return jdbcTemplate.queryForInt( sql );
+ return jdbcTemplate.queryForObject( sql, Integer.class );
}
public void deleteRegularOverlappingData()
@@ -221,7 +221,7 @@
+ "ON pi.programinstanceid = psi.programinstanceid";
log.info( sql );
- return jdbcTemplate.queryForInt( sql );
+ return jdbcTemplate.queryForObject( sql, Integer.class );
}
public int getNumberOfArchivedPatientValues()
@@ -229,7 +229,7 @@
String sql = "SELECT COUNT(*) as dem FROM patientdatavaluearchive;";
log.info( sql );
- return jdbcTemplate.queryForInt( sql );
+ return jdbcTemplate.queryForObject( sql, Integer.class );
}
public void deleteRegularOverlappingPatientData()
=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/sqlview/DefaultSqlViewService.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/sqlview/DefaultSqlViewService.java 2013-04-15 17:17:31 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/sqlview/DefaultSqlViewService.java 2013-04-15 17:38:55 +0000
@@ -140,9 +140,9 @@
// -------------------------------------------------------------------------
@Override
- public boolean isViewTableExists( String viewTableName )
+ public boolean viewTableExists( String viewTableName )
{
- return sqlViewExpandStore.isViewTableExists( viewTableName );
+ return sqlViewExpandStore.viewTableExists( viewTableName );
}
@Override
@@ -168,7 +168,7 @@
@Override
public String createViewTable( SqlView sqlViewInstance )
{
- return sqlViewExpandStore.createView( sqlViewInstance );
+ return sqlViewExpandStore.createViewTable( sqlViewInstance );
}
@Override
=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/sqlview/jdbc/JdbcSqlViewExpandStore.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/sqlview/jdbc/JdbcSqlViewExpandStore.java 2013-04-15 17:17:31 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/sqlview/jdbc/JdbcSqlViewExpandStore.java 2013-04-15 17:38:55 +0000
@@ -73,7 +73,7 @@
// -------------------------------------------------------------------------
@Override
- public boolean isViewTableExists( String viewTableName )
+ public boolean viewTableExists( String viewTableName )
{
try
{
@@ -90,7 +90,7 @@
}
@Override
- public String createView( SqlView sqlViewInstance )
+ public String createViewTable( SqlView sqlViewInstance )
{
String viewName = sqlViewInstance.getViewName();
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/sqlview/CheckViewTableExistenceAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/sqlview/CheckViewTableExistenceAction.java 2012-07-21 13:43:46 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/sqlview/CheckViewTableExistenceAction.java 2013-04-15 17:38:55 +0000
@@ -100,7 +100,7 @@
String viewTableName = sqlViewService.getSqlView( id ).getViewName();
- if ( !sqlViewService.isViewTableExists( viewTableName ) )
+ if ( !sqlViewService.viewTableExists( viewTableName ) )
{
message = i18n.getString( "sql_view_table_is_not_created_yet" );