------------------------------------------------------------ revno: 20511 committer: Lars Helge Overland <larshe...@gmail.com> branch nick: dhis2 timestamp: Mon 2015-10-05 19:32:18 +0200 message: Removed batch handler classes. removed: dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataElementBatchHandlerTest.java dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/CompleteDataSetRegistrationBatchHandler.java dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ConstantBatchHandler.java dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementBatchHandler.java dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementCategoryBatchHandler.java dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementCategoryComboBatchHandler.java dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementCategoryOptionBatchHandler.java dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementGroupBatchHandler.java dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementGroupSetBatchHandler.java dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/GenericBatchHandler.java dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/MapBatchHandler.java dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/OrganisationUnitBatchHandler.java dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/PeriodBatchHandler.java dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/RelativePeriodsBatchHandler.java dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ReportTableBatchHandler.java dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ValidationRuleBatchHandler.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
=== removed file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataElementBatchHandlerTest.java' --- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataElementBatchHandlerTest.java 2015-10-05 17:01:40 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/jdbc/batchhandler/DataElementBatchHandlerTest.java 1970-01-01 00:00:00 +0000 @@ -1,129 +0,0 @@ -package org.hisp.dhis.jdbc.batchhandler; - -/* - * Copyright (c) 2004-2015, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import org.amplecode.quick.BatchHandler; -import org.amplecode.quick.BatchHandlerFactory; -import org.hisp.dhis.DhisTest; -import org.hisp.dhis.dataelement.DataElement; -import org.hisp.dhis.dataelement.DataElementCategoryCombo; -import org.hisp.dhis.dataelement.DataElementCategoryService; -import org.hisp.dhis.dataelement.DataElementService; -import org.junit.Ignore; -import org.junit.Test; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.Collection; - -import static org.junit.Assert.*; - -/** - * @author Lars Helge Overland - */ -@Ignore -public class DataElementBatchHandlerTest - extends DhisTest -{ - @Autowired - private BatchHandlerFactory batchHandlerFactory; - - @Autowired - private DataElementService dataElementService; - - @Autowired - private DataElementCategoryService categoryService; - - private BatchHandler<DataElement> batchHandler; - - private DataElementCategoryCombo categoryCombo; - - private DataElement dataElementA; - private DataElement dataElementB; - private DataElement dataElementC; - - // ------------------------------------------------------------------------- - // Fixture - // ------------------------------------------------------------------------- - - @Override - public void setUpTest() - { - batchHandler = batchHandlerFactory.createBatchHandler( DataElementBatchHandler.class ); - - categoryCombo = categoryService.getDataElementCategoryComboByName( DataElementCategoryCombo.DEFAULT_CATEGORY_COMBO_NAME ); - - batchHandler.init(); - - dataElementA = createDataElement( 'A', categoryCombo ); - dataElementB = createDataElement( 'B', categoryCombo ); - dataElementC = createDataElement( 'C', categoryCombo ); - } - - @Override - public void tearDownTest() - { - batchHandler.flush(); - } - - @Override - public boolean emptyDatabaseAfterTest() - { - return true; - } - - // ------------------------------------------------------------------------- - // Tests - // ------------------------------------------------------------------------- - - @Test - public void testAddObject() - { - batchHandler.addObject( dataElementA ); - batchHandler.addObject( dataElementB ); - batchHandler.addObject( dataElementC ); - - batchHandler.flush(); - - Collection<DataElement> dataElements = dataElementService.getAllDataElements(); - - assertTrue( dataElements.contains( dataElementA ) ); - assertTrue( dataElements.contains( dataElementB ) ); - assertTrue( dataElements.contains( dataElementC ) ); - } - - @Test - public void testObjectExists() - { - dataElementService.addDataElement( dataElementA ); - - assertTrue( batchHandler.objectExists( dataElementA ) ); - - assertFalse( batchHandler.objectExists( dataElementB ) ); - } -} === removed file 'dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/CompleteDataSetRegistrationBatchHandler.java' --- dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/CompleteDataSetRegistrationBatchHandler.java 2015-10-02 11:27:19 +0000 +++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/CompleteDataSetRegistrationBatchHandler.java 1970-01-01 00:00:00 +0000 @@ -1,116 +0,0 @@ -package org.hisp.dhis.jdbc.batchhandler; - -/* - * Copyright (c) 2004-2015, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import org.amplecode.quick.JdbcConfiguration; -import org.amplecode.quick.batchhandler.AbstractBatchHandler; -import org.hisp.dhis.dataset.CompleteDataSetRegistration; - -/** - * @author Lars Helge Overland - * @version $Id$ - */ -public class CompleteDataSetRegistrationBatchHandler - extends AbstractBatchHandler<CompleteDataSetRegistration> -{ - // ------------------------------------------------------------------------- - // Constructor - // ------------------------------------------------------------------------- - - public CompleteDataSetRegistrationBatchHandler( JdbcConfiguration config ) - { - super( config, true ); - } - - // ------------------------------------------------------------------------- - // AbstractBatchHandler implementation - // ------------------------------------------------------------------------- - - @Override - protected void setTableName() - { - statementBuilder.setTableName( "completedatasetregistration" ); - } - - @Override - protected void setIdentifierColumns() - { - statementBuilder.setIdentifierColumn( "datasetid" ); - statementBuilder.setIdentifierColumn( "periodid" ); - statementBuilder.setIdentifierColumn( "sourceid" ); - statementBuilder.setIdentifierColumn( "attributeoptioncomboid" ); - } - - @Override - protected void setIdentifierValues( CompleteDataSetRegistration registration ) - { - statementBuilder.setIdentifierValue( registration.getDataSet().getId() ); - statementBuilder.setIdentifierValue( registration.getPeriod().getId() ); - statementBuilder.setIdentifierValue( registration.getSource().getId() ); - statementBuilder.setIdentifierValue( registration.getAttributeOptionCombo().getId() ); - } - - @Override - protected void setUniqueColumns() - { - statementBuilder.setUniqueColumn( "datasetid" ); - statementBuilder.setUniqueColumn( "periodid" ); - statementBuilder.setUniqueColumn( "sourceid" ); - statementBuilder.setUniqueColumn( "attributeoptioncomboid" ); - } - - @Override - protected void setUniqueValues( CompleteDataSetRegistration registration ) - { - statementBuilder.setUniqueValue( registration.getDataSet().getId() ); - statementBuilder.setUniqueValue( registration.getPeriod().getId() ); - statementBuilder.setUniqueValue( registration.getSource().getId() ); - statementBuilder.setUniqueValue( registration.getAttributeOptionCombo().getId() ); - } - - @Override - protected void setColumns() - { - statementBuilder.setColumn( "datasetid" ); - statementBuilder.setColumn( "periodid" ); - statementBuilder.setColumn( "sourceid" ); - statementBuilder.setColumn( "attributeoptioncomboid" ); - statementBuilder.setColumn( "date" ); - } - - @Override - protected void setValues( CompleteDataSetRegistration registration ) - { - statementBuilder.setValue( registration.getDataSet().getId() ); - statementBuilder.setValue( registration.getPeriod().getId() ); - statementBuilder.setValue( registration.getSource().getId() ); - statementBuilder.setValue( registration.getAttributeOptionCombo().getId() ); - statementBuilder.setValue( registration.getDate() ); - } -} === removed file 'dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ConstantBatchHandler.java' --- dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ConstantBatchHandler.java 2015-10-02 11:27:19 +0000 +++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ConstantBatchHandler.java 1970-01-01 00:00:00 +0000 @@ -1,108 +0,0 @@ -package org.hisp.dhis.jdbc.batchhandler; - -/* - * Copyright (c) 2004-2015, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import org.amplecode.quick.JdbcConfiguration; -import org.amplecode.quick.batchhandler.AbstractBatchHandler; -import org.hisp.dhis.constant.Constant; - -/** - * @author Dang Duy Hieu - * @version $Id$ - */ -public class ConstantBatchHandler - extends AbstractBatchHandler<Constant> -{ - // ------------------------------------------------------------------------- - // Constructor - // ------------------------------------------------------------------------- - - public ConstantBatchHandler( JdbcConfiguration config ) - { - super( config, false ); - } - - // ------------------------------------------------------------------------- - // AbstractBatchHandler implementation - // ------------------------------------------------------------------------- - - @Override - protected void setTableName() - { - statementBuilder.setTableName( "constant" ); - } - - @Override - protected void setAutoIncrementColumn() - { - statementBuilder.setAutoIncrementColumn( "constantid" ); - } - - @Override - protected void setIdentifierColumns() - { - statementBuilder.setIdentifierColumn( "constantid" ); - } - - @Override - protected void setIdentifierValues( Constant constant ) - { - statementBuilder.setIdentifierValue( constant.getId() ); - } - - @Override - protected void setUniqueColumns() - { - statementBuilder.setUniqueColumn( "name" ); - } - - @Override - protected void setUniqueValues( Constant constant ) - { - statementBuilder.setUniqueValue( constant.getName() ); - } - - @Override - protected void setColumns() - { - statementBuilder.setColumn( "uid" ); - statementBuilder.setColumn( "code" ); - statementBuilder.setColumn( "name" ); - statementBuilder.setColumn( "value" ); - } - - @Override - protected void setValues( Constant constant ) - { - statementBuilder.setValue( constant.getUid() ); - statementBuilder.setValue( constant.getCode() ); - statementBuilder.setValue( constant.getName() ); - statementBuilder.setValue( constant.getValue() ); - } -} === removed file 'dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementBatchHandler.java' --- dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementBatchHandler.java 2015-10-02 11:27:19 +0000 +++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementBatchHandler.java 1970-01-01 00:00:00 +0000 @@ -1,124 +0,0 @@ -package org.hisp.dhis.jdbc.batchhandler; - -/* - * Copyright (c) 2004-2015, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import org.amplecode.quick.JdbcConfiguration; -import org.amplecode.quick.batchhandler.AbstractBatchHandler; -import org.hisp.dhis.dataelement.DataElement; - -/** - * @author Lars Helge Overland - * @version $Id: DataElementBatchHandler.java 5242 2008-05-25 09:23:25Z larshelg $ - */ -public class DataElementBatchHandler - extends AbstractBatchHandler<DataElement> -{ - // ------------------------------------------------------------------------- - // Constructor - // ------------------------------------------------------------------------- - - public DataElementBatchHandler( JdbcConfiguration config ) - { - super( config, false ); - } - - // ------------------------------------------------------------------------- - // AbstractBatchHandler implementation - // ------------------------------------------------------------------------- - - @Override - protected void setTableName() - { - statementBuilder.setTableName( "dataelement" ); - } - - @Override - protected void setAutoIncrementColumn() - { - statementBuilder.setAutoIncrementColumn( "dataelementid" ); - } - - @Override - protected void setIdentifierColumns() - { - statementBuilder.setIdentifierColumn( "dataelementid" ); - } - - @Override - protected void setIdentifierValues( DataElement dataElement ) - { - statementBuilder.setIdentifierValue( dataElement.getId() ); - } - - @Override - protected void setUniqueColumns() - { - statementBuilder.setUniqueColumn( "name" ); - statementBuilder.setUniqueColumn( "shortname" ); - statementBuilder.setUniqueColumn( "code" ); - } - - @Override - protected void setUniqueValues( DataElement dataElement ) - { - statementBuilder.setUniqueValue( dataElement.getName() ); - statementBuilder.setUniqueValue( dataElement.getShortName() ); - statementBuilder.setUniqueValue( dataElement.getCode() ); - } - - @Override - protected void setColumns() - { - statementBuilder.setColumn( "uid" ); - statementBuilder.setColumn( "name" ); - statementBuilder.setColumn( "shortname" ); - statementBuilder.setColumn( "code" ); - statementBuilder.setColumn( "description" ); - statementBuilder.setColumn( "valuetype" ); - statementBuilder.setColumn( "domaintype" ); - statementBuilder.setColumn( "aggregationtype" ); - statementBuilder.setColumn( "categorycomboid" ); - statementBuilder.setColumn( "zeroissignificant" ); - } - - @Override - protected void setValues( DataElement dataElement ) - { - statementBuilder.setValue( dataElement.getUid() ); - statementBuilder.setValue( dataElement.getName() ); - statementBuilder.setValue( dataElement.getShortName() ); - statementBuilder.setValue( dataElement.getCode() ); - statementBuilder.setValue( dataElement.getDescription() ); - statementBuilder.setValue( dataElement.getValueType() ); - statementBuilder.setValue( dataElement.getDomainType().name() ); - // statementBuilder.setValue( dataElement.getAggregationOperator() ); - statementBuilder.setValue( dataElement.getCategoryCombo().getId() ); - statementBuilder.setValue( dataElement.isZeroIsSignificant() ); - } -} === removed file 'dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementCategoryBatchHandler.java' --- dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementCategoryBatchHandler.java 2015-10-02 11:27:19 +0000 +++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementCategoryBatchHandler.java 1970-01-01 00:00:00 +0000 @@ -1,106 +0,0 @@ -package org.hisp.dhis.jdbc.batchhandler; - -/* - * Copyright (c) 2004-2015, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import org.amplecode.quick.JdbcConfiguration; -import org.amplecode.quick.batchhandler.AbstractBatchHandler; -import org.hisp.dhis.dataelement.DataElementCategory; - -/** - * @author Lars Helge Overland - * @version $Id$ - */ -public class DataElementCategoryBatchHandler - extends AbstractBatchHandler<DataElementCategory> -{ - // ------------------------------------------------------------------------- - // Constructor - // ------------------------------------------------------------------------- - - public DataElementCategoryBatchHandler( JdbcConfiguration config ) - { - super( config, false ); - } - - // ------------------------------------------------------------------------- - // AbstractBatchHandler implementation - // ------------------------------------------------------------------------- - - @Override - protected void setTableName() - { - statementBuilder.setTableName( "dataelementcategory" ); - } - - @Override - protected void setAutoIncrementColumn() - { - statementBuilder.setAutoIncrementColumn( "categoryid" ); - } - - @Override - protected void setIdentifierColumns() - { - statementBuilder.setIdentifierColumn( "categoryid" ); - } - - @Override - protected void setIdentifierValues( DataElementCategory category ) - { - statementBuilder.setIdentifierValue( category.getId() ); - } - - @Override - protected void setUniqueColumns() - { - statementBuilder.setUniqueColumn( "name" ); - } - - @Override - protected void setUniqueValues( DataElementCategory category ) - { - statementBuilder.setUniqueValue( category.getName() ); - } - - @Override - protected void setColumns() - { - statementBuilder.setColumn( "uid" ); - statementBuilder.setColumn( "code" ); - statementBuilder.setColumn( "name" ); - } - - @Override - protected void setValues( DataElementCategory category ) - { - statementBuilder.setValue( category.getUid() ); - statementBuilder.setValue( category.getCode() ); - statementBuilder.setValue( category.getName() ); - } -} === removed file 'dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementCategoryComboBatchHandler.java' --- dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementCategoryComboBatchHandler.java 2015-10-02 11:27:19 +0000 +++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementCategoryComboBatchHandler.java 1970-01-01 00:00:00 +0000 @@ -1,108 +0,0 @@ -package org.hisp.dhis.jdbc.batchhandler; - -/* - * Copyright (c) 2004-2015, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import org.amplecode.quick.JdbcConfiguration; -import org.amplecode.quick.batchhandler.AbstractBatchHandler; -import org.hisp.dhis.dataelement.DataElementCategoryCombo; - -/** - * @author Lars Helge Overland - * @version $Id$ - */ -public class DataElementCategoryComboBatchHandler - extends AbstractBatchHandler<DataElementCategoryCombo> -{ - // ------------------------------------------------------------------------- - // Constructor - // ------------------------------------------------------------------------- - - public DataElementCategoryComboBatchHandler( JdbcConfiguration config ) - { - super( config, false ); - } - - // ------------------------------------------------------------------------- - // AbstractBatchHandler implementation - // ------------------------------------------------------------------------- - - @Override - protected void setTableName() - { - statementBuilder.setTableName( "categorycombo" ); - } - - @Override - protected void setAutoIncrementColumn() - { - statementBuilder.setAutoIncrementColumn( "categorycomboid" ); - } - - @Override - protected void setIdentifierColumns() - { - statementBuilder.setIdentifierColumn( "categorycomboid" ); - } - - @Override - protected void setIdentifierValues( DataElementCategoryCombo categoryCombo ) - { - statementBuilder.setIdentifierValue( categoryCombo.getId() ); - } - - @Override - protected void setUniqueColumns() - { - statementBuilder.setUniqueColumn( "name" ); - } - - @Override - protected void setUniqueValues( DataElementCategoryCombo categoryCombo ) - { - statementBuilder.setUniqueValue( categoryCombo.getName() ); - } - - @Override - protected void setColumns() - { - statementBuilder.setColumn( "uid" ); - statementBuilder.setColumn( "code" ); - statementBuilder.setColumn( "name" ); - statementBuilder.setColumn( "skiptotal" ); - } - - @Override - protected void setValues( DataElementCategoryCombo categoryCombo ) - { - statementBuilder.setValue( categoryCombo.getUid() ); - statementBuilder.setValue( categoryCombo.getCode() ); - statementBuilder.setValue( categoryCombo.getName() ); - statementBuilder.setValue( categoryCombo.isSkipTotal() ); - } -} === removed file 'dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementCategoryOptionBatchHandler.java' --- dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementCategoryOptionBatchHandler.java 2015-10-02 11:27:19 +0000 +++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementCategoryOptionBatchHandler.java 1970-01-01 00:00:00 +0000 @@ -1,106 +0,0 @@ -package org.hisp.dhis.jdbc.batchhandler; - -/* - * Copyright (c) 2004-2015, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import org.amplecode.quick.JdbcConfiguration; -import org.amplecode.quick.batchhandler.AbstractBatchHandler; -import org.hisp.dhis.dataelement.DataElementCategoryOption; - -/** - * @author Lars Helge Overland - * @version $Id$ - */ -public class DataElementCategoryOptionBatchHandler - extends AbstractBatchHandler<DataElementCategoryOption> -{ - // ------------------------------------------------------------------------- - // Constructor - // ------------------------------------------------------------------------- - - public DataElementCategoryOptionBatchHandler( JdbcConfiguration config ) - { - super( config, false ); - } - - // ------------------------------------------------------------------------- - // AbstractBatchHandler implementation - // ------------------------------------------------------------------------- - - @Override - protected void setTableName() - { - statementBuilder.setTableName( "dataelementcategoryoption" ); - } - - @Override - protected void setAutoIncrementColumn() - { - statementBuilder.setAutoIncrementColumn( "categoryoptionid" ); - } - - @Override - protected void setIdentifierColumns() - { - statementBuilder.setIdentifierColumn( "categoryoptionid" ); - } - - @Override - protected void setIdentifierValues( DataElementCategoryOption categoryOption ) - { - statementBuilder.setIdentifierValue( categoryOption.getId() ); - } - - @Override - protected void setUniqueColumns() - { - statementBuilder.setUniqueColumn( "name" ); - } - - @Override - protected void setUniqueValues( DataElementCategoryOption categoryOption ) - { - statementBuilder.setUniqueValue( categoryOption.getName() ); - } - - @Override - protected void setColumns() - { - statementBuilder.setColumn( "uid" ); - statementBuilder.setColumn( "code" ); - statementBuilder.setColumn( "name" ); - } - - @Override - protected void setValues( DataElementCategoryOption categoryOption ) - { - statementBuilder.setValue( categoryOption.getUid() ); - statementBuilder.setValue( categoryOption.getCode() ); - statementBuilder.setValue( categoryOption.getName() ); - } -} === removed file 'dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementGroupBatchHandler.java' --- dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementGroupBatchHandler.java 2015-10-02 11:27:19 +0000 +++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementGroupBatchHandler.java 1970-01-01 00:00:00 +0000 @@ -1,108 +0,0 @@ -package org.hisp.dhis.jdbc.batchhandler; - -/* - * Copyright (c) 2004-2015, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import org.amplecode.quick.JdbcConfiguration; -import org.amplecode.quick.batchhandler.AbstractBatchHandler; -import org.hisp.dhis.dataelement.DataElementGroup; - -/** - * @author Lars Helge Overland - * @version $Id: DataElementGroupBatchHandler.java 5062 2008-05-01 18:10:35Z larshelg $ - */ -public class DataElementGroupBatchHandler - extends AbstractBatchHandler<DataElementGroup> -{ - // ------------------------------------------------------------------------- - // Constructor - // ------------------------------------------------------------------------- - - public DataElementGroupBatchHandler( JdbcConfiguration config ) - { - super( config, false ); - } - - // ------------------------------------------------------------------------- - // AbstractBatchHandler implementation - // ------------------------------------------------------------------------- - - @Override - protected void setTableName() - { - statementBuilder.setTableName( "dataelementgroup" ); - } - - @Override - protected void setAutoIncrementColumn() - { - statementBuilder.setAutoIncrementColumn( "dataelementgroupid" ); - } - - @Override - protected void setIdentifierColumns() - { - statementBuilder.setIdentifierColumn( "dataelementgroupid" ); - } - - @Override - protected void setIdentifierValues( DataElementGroup group ) - { - statementBuilder.setIdentifierValue( group.getId() ); - } - - @Override - protected void setUniqueColumns() - { - statementBuilder.setUniqueColumn( "name" ); - } - - @Override - protected void setUniqueValues( DataElementGroup group ) - { - statementBuilder.setUniqueValue( group.getName() ); - } - - @Override - protected void setColumns() - { - statementBuilder.setColumn( "uid" ); - statementBuilder.setColumn( "code" ); - statementBuilder.setColumn( "name" ); - statementBuilder.setColumn( "shortname" ); - } - - @Override - protected void setValues( DataElementGroup group ) - { - statementBuilder.setValue( group.getUid() ); - statementBuilder.setValue( group.getCode() ); - statementBuilder.setValue( group.getName() ); - statementBuilder.setValue( group.getShortName() ); - } -} === removed file 'dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementGroupSetBatchHandler.java' --- dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementGroupSetBatchHandler.java 2015-10-02 11:27:19 +0000 +++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementGroupSetBatchHandler.java 1970-01-01 00:00:00 +0000 @@ -1,112 +0,0 @@ -package org.hisp.dhis.jdbc.batchhandler; - -/* - * Copyright (c) 2004-2015, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import org.amplecode.quick.JdbcConfiguration; -import org.amplecode.quick.batchhandler.AbstractBatchHandler; -import org.hisp.dhis.dataelement.DataElementGroupSet; - -/** - * @author Lars Helge Overland - * @version $Id$ - */ -public class DataElementGroupSetBatchHandler - extends AbstractBatchHandler<DataElementGroupSet> -{ - // ------------------------------------------------------------------------- - // Constructor - // ------------------------------------------------------------------------- - - public DataElementGroupSetBatchHandler( JdbcConfiguration config ) - { - super( config, false ); - } - - // ------------------------------------------------------------------------- - // AbstractBatchHandler implementation - // ------------------------------------------------------------------------- - - @Override - protected void setTableName() - { - statementBuilder.setTableName( "dataelementgroupset" ); - } - - @Override - protected void setAutoIncrementColumn() - { - statementBuilder.setAutoIncrementColumn( "dataelementgroupsetid" ); - } - - @Override - protected void setIdentifierColumns() - { - statementBuilder.setIdentifierColumn( "dataelementgroupsetid" ); - } - - @Override - protected void setIdentifierValues( DataElementGroupSet groupSet ) - { - statementBuilder.setIdentifierValue( groupSet.getId() ); - } - - @Override - protected void setUniqueColumns() - { - statementBuilder.setUniqueColumn( "name" ); - } - - @Override - protected void setUniqueValues( DataElementGroupSet groupSet ) - { - statementBuilder.setUniqueValue( groupSet.getName() ); - } - - @Override - protected void setColumns() - { - statementBuilder.setColumn( "uid" ); - statementBuilder.setColumn( "code" ); - statementBuilder.setColumn( "name" ); - statementBuilder.setColumn( "description" ); - statementBuilder.setColumn( "compulsory" ); - statementBuilder.setColumn( "datadimension" ); - } - - @Override - protected void setValues( DataElementGroupSet groupSet ) - { - statementBuilder.setValue( groupSet.getUid() ); - statementBuilder.setValue( groupSet.getCode() ); - statementBuilder.setValue( groupSet.getName() ); - statementBuilder.setValue( groupSet.getDescription() ); - statementBuilder.setValue( groupSet.isCompulsory() ); - statementBuilder.setValue( groupSet.isDataDimension() ); - } -} === removed file 'dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/GenericBatchHandler.java' --- dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/GenericBatchHandler.java 2015-10-02 11:27:19 +0000 +++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/GenericBatchHandler.java 1970-01-01 00:00:00 +0000 @@ -1,97 +0,0 @@ -package org.hisp.dhis.jdbc.batchhandler; - -/* - * Copyright (c) 2004-2015, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import java.util.List; - -import org.amplecode.quick.JdbcConfiguration; -import org.amplecode.quick.batchhandler.AbstractBatchHandler; - -/** - * @author Lars Helge Overland - * @version $Id$ - */ -public class GenericBatchHandler - extends AbstractBatchHandler<Object> -{ - // ------------------------------------------------------------------------- - // Constructor - // ------------------------------------------------------------------------- - - public GenericBatchHandler( JdbcConfiguration config ) - { - super( config, true ); - } - - // ------------------------------------------------------------------------- - // AbstractBatchHandler implementation - // ------------------------------------------------------------------------- - - @Override - protected void setTableName() - { - // Must be set externally - } - - @Override - protected String getInsertStatementOpening() - { - return statementBuilder.getNoColumnInsertStatementOpening(); - } - - @Override - protected void setUniqueColumns() - { - // Cannot be known - } - - @Override - protected void setUniqueValues( Object object ) - { - // Cannot be known - } - - @Override - protected void setColumns() - { - // Not in use - } - - @Override - @SuppressWarnings( "unchecked" ) - protected void setValues( Object object ) - { - List<Object> values = (List<Object>) object; - - for ( Object value : values ) - { - statementBuilder.setValue( value ); - } - } -} === removed file 'dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/MapBatchHandler.java' --- dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/MapBatchHandler.java 2015-10-02 11:27:19 +0000 +++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/MapBatchHandler.java 1970-01-01 00:00:00 +0000 @@ -1,109 +0,0 @@ -package org.hisp.dhis.jdbc.batchhandler; - -/* - * Copyright (c) 2004-2015, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import org.amplecode.quick.JdbcConfiguration; -import org.amplecode.quick.batchhandler.AbstractBatchHandler; -import org.hisp.dhis.mapping.Map; - -/** - * @author Lars Helge Overland - */ -public class MapBatchHandler - extends AbstractBatchHandler<Map> -{ - // ------------------------------------------------------------------------- - // Constructor - // ------------------------------------------------------------------------- - - public MapBatchHandler( JdbcConfiguration config ) - { - super( config, false ); - } - - // ------------------------------------------------------------------------- - // AbstractBatchHandler implementation - // ------------------------------------------------------------------------- - - @Override - protected void setTableName() - { - statementBuilder.setTableName( "map" ); - } - - @Override - protected void setAutoIncrementColumn() - { - statementBuilder.setAutoIncrementColumn( "mapid" ); - } - - @Override - protected void setIdentifierColumns() - { - statementBuilder.setIdentifierColumn( "mapid" ); - } - - @Override - protected void setIdentifierValues( Map map ) - { - statementBuilder.setIdentifierValue( map.getId() ); - } - - @Override - protected void setUniqueColumns() - { - } - - @Override - protected void setUniqueValues( Map object ) - { - } - - @Override - protected void setColumns() - { - statementBuilder.setColumn( "uid" ); - statementBuilder.setColumn( "name" ); - statementBuilder.setColumn( "userid" ); - statementBuilder.setColumn( "longitude" ); - statementBuilder.setColumn( "latitude" ); - statementBuilder.setColumn( "zoom" ); - } - - @Override - protected void setValues( Map map ) - { - statementBuilder.setValue( map.getUid() ); - statementBuilder.setValue( map.getName() ); - statementBuilder.setValue( map.getUser() != null ? map.getUser().getId() : null ); - statementBuilder.setValue( map.getLongitude() ); - statementBuilder.setValue( map.getLatitude() ); - statementBuilder.setValue( map.getZoom() ); - } -} === removed file 'dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/OrganisationUnitBatchHandler.java' --- dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/OrganisationUnitBatchHandler.java 2015-10-02 11:27:19 +0000 +++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/OrganisationUnitBatchHandler.java 1970-01-01 00:00:00 +0000 @@ -1,126 +0,0 @@ -package org.hisp.dhis.jdbc.batchhandler; - -/* - * Copyright (c) 2004-2015, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import org.amplecode.quick.JdbcConfiguration; -import org.amplecode.quick.batchhandler.AbstractBatchHandler; -import org.hisp.dhis.organisationunit.OrganisationUnit; - -/** - * @author Lars Helge Overland - * @version $Id: OrganisationUnitBatchHandler.java 5062 2008-05-01 18:10:35Z larshelg $ - */ -public class OrganisationUnitBatchHandler - extends AbstractBatchHandler<OrganisationUnit> -{ - // ------------------------------------------------------------------------- - // Constructor - // ------------------------------------------------------------------------- - - public OrganisationUnitBatchHandler( JdbcConfiguration config ) - { - super( config, false ); - } - - // ------------------------------------------------------------------------- - // AbstractBatchHandler implementation - // ------------------------------------------------------------------------- - - @Override - protected void setTableName() - { - statementBuilder.setTableName( "organisationunit" ); - } - - @Override - protected void setAutoIncrementColumn() - { - statementBuilder.setAutoIncrementColumn( "organisationunitid" ); - } - - @Override - protected void setIdentifierColumns() - { - statementBuilder.setIdentifierColumn( "organisationunitid" ); - } - - @Override - protected void setIdentifierValues( OrganisationUnit unit ) - { - statementBuilder.setIdentifierValue( unit.getId() ); - } - - @Override - protected void setUniqueColumns() - { - statementBuilder.setUniqueColumn( "name" ); - statementBuilder.setUniqueColumn( "shortname" ); - statementBuilder.setUniqueColumn( "code" ); - } - - @Override - protected void setUniqueValues( OrganisationUnit unit ) - { - statementBuilder.setUniqueValue( unit.getName() ); - statementBuilder.setUniqueValue( unit.getShortName() ); - statementBuilder.setUniqueValue( unit.getCode() ); - } - - @Override - protected void setColumns() - { - statementBuilder.setColumn( "uid" ); - statementBuilder.setColumn( "name" ); - statementBuilder.setColumn( "parentid" ); - statementBuilder.setColumn( "shortname" ); - statementBuilder.setColumn( "code" ); - statementBuilder.setColumn( "description" ); - statementBuilder.setColumn( "openingdate" ); - statementBuilder.setColumn( "closeddate" ); - statementBuilder.setColumn( "comment" ); - statementBuilder.setColumn( "featuretype" ); - statementBuilder.setColumn( "coordinates" ); - } - - @Override - protected void setValues( OrganisationUnit unit ) - { - statementBuilder.setValue( unit.getUid() ); - statementBuilder.setValue( unit.getName() ); - statementBuilder.setValue( unit.getParent() != null ? unit.getParent().getId() : null ); - statementBuilder.setValue( unit.getShortName() ); - statementBuilder.setValue( unit.getCode() ); - statementBuilder.setValue( unit.getDescription() ); - statementBuilder.setValue( unit.getOpeningDate() ); - statementBuilder.setValue( unit.getClosedDate() ); - statementBuilder.setValue( unit.getComment() ); - statementBuilder.setValue( unit.getFeatureType() ); - statementBuilder.setValue( unit.getCoordinates() ); - } -} === removed file 'dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/PeriodBatchHandler.java' --- dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/PeriodBatchHandler.java 2015-10-02 11:27:19 +0000 +++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/PeriodBatchHandler.java 1970-01-01 00:00:00 +0000 @@ -1,128 +0,0 @@ -package org.hisp.dhis.jdbc.batchhandler; - -/* - * Copyright (c) 2004-2015, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import org.amplecode.quick.JdbcConfiguration; -import org.amplecode.quick.batchhandler.AbstractBatchHandler; -import org.hisp.dhis.period.Period; - -/** - * @author Lars Helge Overland - * @version $Id: PeriodBatchHandler.java 5062 2008-05-01 18:10:35Z larshelg $ - */ -public class PeriodBatchHandler - extends AbstractBatchHandler<Period> -{ - // ------------------------------------------------------------------------- - // Constructor - // ------------------------------------------------------------------------- - - public PeriodBatchHandler( JdbcConfiguration config ) - { - super( config, true ); - } - - // ------------------------------------------------------------------------- - // AbstractBatchHandler implementation - // ------------------------------------------------------------------------- - - @Override - protected void setTableName() - { - statementBuilder.setTableName( "period" ); - } - - @Override - protected void setAutoIncrementColumn() - { - statementBuilder.setAutoIncrementColumn( "periodid" ); - } - - @Override - protected void setIdentifierColumns() - { - statementBuilder.setIdentifierColumn( "periodid" ); - } - - @Override - protected void setIdentifierValues( Period period ) - { - statementBuilder.setIdentifierValue( period.getId() ); - } - - @Override - protected void setMatchColumns() - { - statementBuilder.setMatchColumn( "periodtypeid" ); - statementBuilder.setMatchColumn( "startdate" ); - statementBuilder.setMatchColumn( "enddate" ); - } - - @Override - protected void setMatchValues( Object object ) - { - Period period = (Period) object; - - statementBuilder.setMatchValue( period.getPeriodType().getId() ); - statementBuilder.setMatchValue( period.getStartDate() ); - statementBuilder.setMatchValue( period.getEndDate() ); - } - - @Override - protected void setUniqueColumns() - { - statementBuilder.setUniqueColumn( "periodtypeid" ); - statementBuilder.setUniqueColumn( "startdate" ); - statementBuilder.setUniqueColumn( "enddate" ); - } - - @Override - protected void setUniqueValues( Period period ) - { - statementBuilder.setUniqueValue( period.getPeriodType().getId() ); - statementBuilder.setUniqueValue( period.getStartDate() ); - statementBuilder.setUniqueValue( period.getEndDate() ); - } - - @Override - protected void setColumns() - { - statementBuilder.setColumn( "periodtypeid" ); - statementBuilder.setColumn( "startdate" ); - statementBuilder.setColumn( "enddate" ); - } - - @Override - protected void setValues( Period period ) - { - statementBuilder.setValue( period.getPeriodType().getId() ); - statementBuilder.setValue( period.getStartDate() ); - statementBuilder.setValue( period.getEndDate() ); - } -} === removed file 'dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/RelativePeriodsBatchHandler.java' --- dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/RelativePeriodsBatchHandler.java 2015-10-02 11:27:19 +0000 +++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/RelativePeriodsBatchHandler.java 1970-01-01 00:00:00 +0000 @@ -1,139 +0,0 @@ -package org.hisp.dhis.jdbc.batchhandler; - -/* - * Copyright (c) 2004-2015, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import org.amplecode.quick.JdbcConfiguration; -import org.amplecode.quick.batchhandler.AbstractBatchHandler; -import org.hisp.dhis.period.RelativePeriods; - -public class RelativePeriodsBatchHandler - extends AbstractBatchHandler<RelativePeriods> -{ - // ------------------------------------------------------------------------- - // Constructor - // ------------------------------------------------------------------------- - - public RelativePeriodsBatchHandler( JdbcConfiguration configuration ) - { - super( configuration, false ); - } - // ------------------------------------------------------------------------- - // AbstractBatchHandler implementation - // ------------------------------------------------------------------------- - - @Override - protected void setTableName() - { - statementBuilder.setTableName( "relativeperiods" ); - } - - @Override - protected void setAutoIncrementColumn() - { - statementBuilder.setAutoIncrementColumn( "relativeperiodsid" ); - } - - @Override - protected void setIdentifierColumns() - { - statementBuilder.setIdentifierColumn( "relativeperiodsid" ); - } - - @Override - protected void setIdentifierValues( RelativePeriods relatives ) - { - statementBuilder.setIdentifierValue( relatives.getId() ); - } - - @Override - protected void setUniqueColumns() - { - } - - @Override - protected void setUniqueValues( RelativePeriods relatives ) - { - } - - @Override - protected void setColumns() - { - statementBuilder.setColumn( "lastmonth" ); - statementBuilder.setColumn( "lastbimonth" ); - statementBuilder.setColumn( "lastquarter" ); - statementBuilder.setColumn( "lastsixmonth" ); - statementBuilder.setColumn( "monthsthisyear" ); - statementBuilder.setColumn( "quartersthisyear" ); - statementBuilder.setColumn( "thisyear" ); - statementBuilder.setColumn( "monthslastyear" ); - statementBuilder.setColumn( "quarterslastyear" ); - statementBuilder.setColumn( "lastyear" ); - statementBuilder.setColumn( "last5years" ); - statementBuilder.setColumn( "last12months" ); - statementBuilder.setColumn( "last3months" ); - statementBuilder.setColumn( "last6bimonths" ); - statementBuilder.setColumn( "last4quarters" ); - statementBuilder.setColumn( "last2sixmonths" ); - statementBuilder.setColumn( "thisfinancialyear" ); - statementBuilder.setColumn( "lastfinancialyear" ); - statementBuilder.setColumn( "last5financialyears" ); - statementBuilder.setColumn( "lastweek" ); - statementBuilder.setColumn( "last4weeks" ); - statementBuilder.setColumn( "last12weeks" ); - statementBuilder.setColumn( "last52weeks" ); - } - - @Override - protected void setValues( RelativePeriods relatives ) - { - statementBuilder.setValue( relatives.isLastMonth() ); - statementBuilder.setValue( relatives.isLastBimonth() ); - statementBuilder.setValue( relatives.isLastQuarter() ); - statementBuilder.setValue( relatives.isLastSixMonth() ); - statementBuilder.setValue( relatives.isMonthsThisYear() ); - statementBuilder.setValue( relatives.isQuartersThisYear() ); - statementBuilder.setValue( relatives.isThisYear() ); - statementBuilder.setValue( relatives.isMonthsLastYear() ); - statementBuilder.setValue( relatives.isQuartersLastYear() ); - statementBuilder.setValue( relatives.isLastYear() ); - statementBuilder.setValue( relatives.isLast5Years() ); - statementBuilder.setValue( relatives.isLast12Months() ); - statementBuilder.setValue( relatives.isLast3Months() ); - statementBuilder.setValue( relatives.isLast6BiMonths() ); - statementBuilder.setValue( relatives.isLast4Quarters() ); - statementBuilder.setValue( relatives.isLast2SixMonths() ); - statementBuilder.setValue( relatives.isThisFinancialYear() ); - statementBuilder.setValue( relatives.isLastFinancialYear() ); - statementBuilder.setValue( relatives.isLast5FinancialYears() ); - statementBuilder.setValue( relatives.isLastWeek() ); - statementBuilder.setValue( relatives.isLast4Weeks() ); - statementBuilder.setValue( relatives.isLast12Weeks() ); - statementBuilder.setValue( relatives.isLast52Weeks() ); - } -} === removed file 'dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ReportTableBatchHandler.java' --- dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ReportTableBatchHandler.java 2015-10-02 11:27:19 +0000 +++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ReportTableBatchHandler.java 1970-01-01 00:00:00 +0000 @@ -1,132 +0,0 @@ -package org.hisp.dhis.jdbc.batchhandler; - -/* - * Copyright (c) 2004-2015, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import org.amplecode.quick.JdbcConfiguration; -import org.amplecode.quick.batchhandler.AbstractBatchHandler; -import org.hisp.dhis.reporttable.ReportTable; - -/** - * @author Lars Helge Overland - * @version $Id$ - */ -public class ReportTableBatchHandler - extends AbstractBatchHandler<ReportTable> -{ - // ------------------------------------------------------------------------- - // Constructor - // ------------------------------------------------------------------------- - - public ReportTableBatchHandler( JdbcConfiguration config ) - { - super( config, false ); - } - - // ------------------------------------------------------------------------- - // AbstractBatchHandler implementation - // ------------------------------------------------------------------------- - - @Override - protected void setTableName() - { - statementBuilder.setTableName( "reporttable" ); - } - - @Override - protected void setAutoIncrementColumn() - { - statementBuilder.setAutoIncrementColumn( "reporttableid" ); - } - - @Override - protected void setIdentifierColumns() - { - statementBuilder.setIdentifierColumn( "reporttableid" ); - } - - @Override - protected void setIdentifierValues( ReportTable reportTable ) - { - statementBuilder.setIdentifierValue( reportTable.getId() ); - } - - @Override - protected void setUniqueColumns() - { - statementBuilder.setUniqueColumn( "name" ); - } - - @Override - protected void setUniqueValues( ReportTable reportTable ) - { - statementBuilder.setUniqueValue( reportTable.getName() ); - } - - @Override - protected void setColumns() - { - statementBuilder.setColumn( "uid" ); - statementBuilder.setColumn( "code" ); - statementBuilder.setColumn( "name" ); - statementBuilder.setColumn( "regression" ); - - statementBuilder.setColumn( "reportingmonth" ); - statementBuilder.setColumn( "monthsthisyear" ); - statementBuilder.setColumn( "quartersthisyear" ); - statementBuilder.setColumn( "thisyear" ); - statementBuilder.setColumn( "monthslastyear" ); - statementBuilder.setColumn( "quarterslastyear" ); - statementBuilder.setColumn( "lastyear" ); - - statementBuilder.setColumn( "paramreportingmonth" ); - statementBuilder.setColumn( "paramparentorganisationunit" ); - statementBuilder.setColumn( "paramorganisationunit" ); - } - - @Override - protected void setValues( ReportTable reportTable ) - { - statementBuilder.setValue( reportTable.getUid() ); - statementBuilder.setValue( reportTable.getCode() ); - statementBuilder.setValue( reportTable.getName() ); - statementBuilder.setValue( reportTable.isRegression() ); - - statementBuilder.setValue( reportTable.getRelatives().isLastMonth() ); - statementBuilder.setValue( reportTable.getRelatives().isMonthsThisYear() ); - statementBuilder.setValue( reportTable.getRelatives().isQuartersThisYear() ); - statementBuilder.setValue( reportTable.getRelatives().isThisYear() ); - statementBuilder.setValue( reportTable.getRelatives().isMonthsLastYear() ); - statementBuilder.setValue( reportTable.getRelatives().isQuartersLastYear() ); - statementBuilder.setValue( reportTable.getRelatives().isLastYear() ); - - statementBuilder.setValue( reportTable.getReportParams().isParamReportingMonth() ); - statementBuilder.setValue( reportTable.getReportParams().isParamParentOrganisationUnit() ); - statementBuilder.setValue( reportTable.getReportParams().isParamOrganisationUnit() ); - } -} === removed file 'dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ValidationRuleBatchHandler.java' --- dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ValidationRuleBatchHandler.java 2015-10-02 11:27:19 +0000 +++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ValidationRuleBatchHandler.java 1970-01-01 00:00:00 +0000 @@ -1,109 +0,0 @@ -package org.hisp.dhis.jdbc.batchhandler; - -/* - * Copyright (c) 2004-2015, University of Oslo - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of the HISP project nor the names of its contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import org.amplecode.quick.JdbcConfiguration; -import org.amplecode.quick.batchhandler.AbstractBatchHandler; -import org.hisp.dhis.validation.ValidationRule; - -public class ValidationRuleBatchHandler -extends AbstractBatchHandler<ValidationRule> -{ - // ------------------------------------------------------------------------- - // Constructor - // ------------------------------------------------------------------------- - - public ValidationRuleBatchHandler( JdbcConfiguration config ) - { - super( config, false ); - } - - // ------------------------------------------------------------------------- - // AbstractBatchHandler implementation - // ------------------------------------------------------------------------- - - @Override - protected void setTableName() - { - statementBuilder.setTableName( "dataelement" ); - } - - @Override - protected void setAutoIncrementColumn() - { - statementBuilder.setAutoIncrementColumn( "dataelementid" ); - } - - @Override - protected void setIdentifierColumns() - { - statementBuilder.setIdentifierColumn( "validationruleid" ); - } - - @Override - protected void setIdentifierValues( ValidationRule validationRule ) - { - statementBuilder.setIdentifierValue( validationRule.getId() ); - } - - @Override - protected void setUniqueColumns() - { - statementBuilder.setUniqueColumn( "name" ); - statementBuilder.setUniqueColumn( "code" ); - } - - @Override - protected void setUniqueValues( ValidationRule validationRule ) - { - statementBuilder.setUniqueValue( validationRule.getName() ); - statementBuilder.setUniqueValue( validationRule.getCode() ); - } - - @Override - protected void setColumns() - { - statementBuilder.setColumn( "uid" ); - statementBuilder.setColumn( "name" ); - statementBuilder.setColumn( "code" ); - statementBuilder.setColumn( "description" ); - statementBuilder.setColumn( "operator" ); - } - - @Override - protected void setValues( ValidationRule validationRule ) - { - statementBuilder.setValue( validationRule.getUid() ); - statementBuilder.setValue( validationRule.getName() ); - statementBuilder.setValue( validationRule.getCode() ); - statementBuilder.setValue( validationRule.getDescription() ); - statementBuilder.setValue( validationRule.getOperator() ); - } - -} \ No newline at end of file
_______________________________________________ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp