dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #36961
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18907: Resource tables, centralized logging of create table statements
------------------------------------------------------------
revno: 18907
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2015-04-15 16:23:40 +0200
message:
Resource tables, centralized logging of create table statements
modified:
dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/jdbc/JdbcResourceTableStore.java
dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateCategoryOptionGroupSetTableStatement.java
dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateCategoryTableStatement.java
dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateDataElementGroupSetTableStatement.java
dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateIndicatorGroupSetTableStatement.java
dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateOrganisationUnitGroupSetTableStatement.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-administration/src/main/java/org/hisp/dhis/resourcetable/jdbc/JdbcResourceTableStore.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/jdbc/JdbcResourceTableStore.java 2015-04-07 13:23:35 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/jdbc/JdbcResourceTableStore.java 2015-04-15 14:23:40 +0000
@@ -30,7 +30,6 @@
import java.util.List;
-import org.amplecode.quick.Statement;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hisp.dhis.dataelement.CategoryOptionGroupSet;
@@ -180,9 +179,11 @@
// Do nothing, table does not exist
}
- Statement statement = new CreateCategoryOptionGroupSetTableStatement( groupSets, statementBuilder.getColumnQuote() );
-
- jdbcTemplate.execute( statement.getStatement() );
+ final String statement = new CreateCategoryOptionGroupSetTableStatement( groupSets, statementBuilder.getColumnQuote() ).getStatement();
+
+ log.info( "Create category option group set table SQL: " + statement );
+
+ jdbcTemplate.execute( statement );
}
// -------------------------------------------------------------------------
@@ -201,9 +202,11 @@
// Do nothing, table does not exist
}
- Statement statement = new CreateDataElementGroupSetTableStatement( groupSets, statementBuilder.getColumnQuote() );
-
- jdbcTemplate.execute( statement.getStatement() );
+ final String statement = new CreateDataElementGroupSetTableStatement( groupSets, statementBuilder.getColumnQuote() ).getStatement();
+
+ log.info( "Create data element group set table SQL: " + statement );
+
+ jdbcTemplate.execute( statement );
}
@Override
@@ -254,9 +257,11 @@
// Do nothing, table does not exist
}
- Statement statement = new CreateIndicatorGroupSetTableStatement( groupSets, statementBuilder.getColumnQuote() );
+ final String statement = new CreateIndicatorGroupSetTableStatement( groupSets, statementBuilder.getColumnQuote() ).getStatement();
+
+ log.info( "Create indicator group set table SQL: " + statement );
- jdbcTemplate.execute( statement.getStatement() );
+ jdbcTemplate.execute( statement );
}
@Override
@@ -307,9 +312,11 @@
// Do nothing, table does not exist
}
- Statement statement = new CreateOrganisationUnitGroupSetTableStatement( groupSets, statementBuilder.getColumnQuote() );
+ final String statement = new CreateOrganisationUnitGroupSetTableStatement( groupSets, statementBuilder.getColumnQuote() ).getStatement();
+
+ log.info( "Create organisation unit group set table SQL: " + statement );
- jdbcTemplate.execute( statement.getStatement() );
+ jdbcTemplate.execute( statement );
}
@Override
@@ -360,9 +367,11 @@
// Do nothing, table does not exist
}
- Statement statement = new CreateCategoryTableStatement( categories, statementBuilder.getColumnQuote() );
+ final String statement = new CreateCategoryTableStatement( categories, statementBuilder.getColumnQuote() ).getStatement();
+
+ log.info( "Create category structure table SQL: " + statement );
- jdbcTemplate.execute( statement.getStatement() );
+ jdbcTemplate.execute( statement );
}
@Override
=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateCategoryOptionGroupSetTableStatement.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateCategoryOptionGroupSetTableStatement.java 2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateCategoryOptionGroupSetTableStatement.java 2015-04-15 14:23:40 +0000
@@ -31,8 +31,6 @@
import java.util.List;
import org.amplecode.quick.Statement;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.hisp.dhis.dataelement.CategoryOptionGroupSet;
/**
@@ -41,8 +39,6 @@
public class CreateCategoryOptionGroupSetTableStatement
implements Statement
{
- private static final Log log = LogFactory.getLog( CreateCategoryOptionGroupSetTableStatement.class );
-
private static final String LONG_TEXT_COLUMN_TYPE = "VARCHAR (250)";
public static final String TABLE_NAME = "_categoryoptiongroupsetstructure";
@@ -70,8 +66,6 @@
}
statement += "PRIMARY KEY ( categoryoptioncomboid ) )";
-
- log.info( "Create category option group set table SQL: " + statement );
return statement;
}
=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateCategoryTableStatement.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateCategoryTableStatement.java 2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateCategoryTableStatement.java 2015-04-15 14:23:40 +0000
@@ -31,8 +31,6 @@
import java.util.List;
import org.amplecode.quick.Statement;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.hisp.dhis.dataelement.DataElementCategory;
/**
@@ -41,8 +39,6 @@
public class CreateCategoryTableStatement
implements Statement
{
- private static final Log log = LogFactory.getLog( CreateCategoryTableStatement.class );
-
private static final String LONG_TEXT_COLUMN_TYPE = "VARCHAR (250)";
public static final String TABLE_NAME = "_categorystructure";
@@ -71,8 +67,6 @@
}
statement += "PRIMARY KEY ( categoryoptioncomboid ) )";
-
- log.info( "Create category structure table SQL: " + statement );
return statement;
}
=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateDataElementGroupSetTableStatement.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateDataElementGroupSetTableStatement.java 2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateDataElementGroupSetTableStatement.java 2015-04-15 14:23:40 +0000
@@ -31,8 +31,6 @@
import java.util.List;
import org.amplecode.quick.Statement;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.hisp.dhis.dataelement.DataElementGroupSet;
/**
@@ -41,8 +39,6 @@
public class CreateDataElementGroupSetTableStatement
implements Statement
{
- private static final Log log = LogFactory.getLog( CreateDataElementGroupSetTableStatement.class );
-
private static final String LONG_TEXT_COLUMN_TYPE = "VARCHAR (250)";
public static final String TABLE_NAME = "_dataelementgroupsetstructure";
@@ -71,8 +67,6 @@
}
statement += "PRIMARY KEY ( dataelementid ) )";
-
- log.info( "Create data element group set table SQL: " + statement );
return statement;
}
=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateIndicatorGroupSetTableStatement.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateIndicatorGroupSetTableStatement.java 2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateIndicatorGroupSetTableStatement.java 2015-04-15 14:23:40 +0000
@@ -31,8 +31,6 @@
import java.util.List;
import org.amplecode.quick.Statement;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.hisp.dhis.indicator.IndicatorGroupSet;
/**
@@ -41,8 +39,6 @@
public class CreateIndicatorGroupSetTableStatement
implements Statement
{
- private static final Log log = LogFactory.getLog( CreateIndicatorGroupSetTableStatement.class );
-
private static final String LONG_TEXT_COLUMN_TYPE = "VARCHAR (250)";
public static final String TABLE_NAME = "_indicatorgroupsetstructure";
@@ -50,8 +46,7 @@
private List<IndicatorGroupSet> groupSets;
private String quote;
-
-
+
public CreateIndicatorGroupSetTableStatement( List<IndicatorGroupSet> groupSets, String quote )
{
this.groupSets = groupSets;
@@ -72,8 +67,6 @@
}
statement += "PRIMARY KEY ( indicatorid ) )";
-
- log.info( "Create indicator group set table SQL: " + statement );
return statement;
}
=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateOrganisationUnitGroupSetTableStatement.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateOrganisationUnitGroupSetTableStatement.java 2015-01-17 07:41:26 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateOrganisationUnitGroupSetTableStatement.java 2015-04-15 14:23:40 +0000
@@ -31,8 +31,6 @@
import java.util.List;
import org.amplecode.quick.Statement;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet;
/**
@@ -41,8 +39,6 @@
public class CreateOrganisationUnitGroupSetTableStatement
implements Statement
{
- private static final Log log = LogFactory.getLog( CreateOrganisationUnitGroupSetTableStatement.class );
-
public static final String TABLE_NAME = "_organisationunitgroupsetstructure";
private static final String LONG_TEXT_COLUMN_TYPE = "VARCHAR (250)";
@@ -72,8 +68,6 @@
statement += "PRIMARY KEY ( organisationunitid ) )";
- log.info( "Create organisation unit group set table SQL: " + statement );
-
return statement;
}
}