=== removed file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/AttributeValueStore.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/AttributeValueStore.java 2011-09-07 13:42:12 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/attribute/AttributeValueStore.java 1970-01-01 00:00:00 +0000 @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2004-2010, 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. - */ - -package org.hisp.dhis.attribute; - -import org.hisp.dhis.common.GenericStore; - -/** - * @author mortenoh - */ -public interface AttributeValueStore - extends GenericStore -{ - String ID = AttributeValueStore.class.getName(); - - int getCount(); -} === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GenericIdentifiableObjectStore.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GenericIdentifiableObjectStore.java 2011-11-22 15:48:30 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GenericIdentifiableObjectStore.java 2011-12-09 18:58:11 +0000 @@ -81,13 +81,6 @@ Collection getBetweenByName( String name, int first, int max ); /** - * Gets the count of objects. - * - * @return the count of objects. - */ - int getCount(); - - /** * Gets the count of objects which name is like the given name. * * @param name the name which result object names must be like. === modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GenericStore.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GenericStore.java 2011-09-07 13:42:12 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GenericStore.java 2011-12-09 18:58:11 +0000 @@ -97,4 +97,11 @@ * @param object the object instance to delete. */ void delete( T object ); + + /** + * Gets the count of objects. + * + * @return the count of objects. + */ + int getCount(); } === modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/attribute/DefaultAttributeService.java' --- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/attribute/DefaultAttributeService.java 2011-11-23 18:37:43 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/attribute/DefaultAttributeService.java 2011-12-09 18:58:11 +0000 @@ -26,6 +26,7 @@ import java.util.HashSet; import java.util.Set; +import org.hisp.dhis.common.GenericStore; import org.springframework.transaction.annotation.Transactional; /** @@ -41,24 +42,14 @@ private AttributeStore attributeStore; - public AttributeStore getAttributeStore() - { - return attributeStore; - } - public void setAttributeStore( AttributeStore attributeStore ) { this.attributeStore = attributeStore; } - private AttributeValueStore attributeValueStore; - - public AttributeValueStore getAttributeValueStore() - { - return attributeValueStore; - } - - public void setAttributeValueStore( AttributeValueStore attributeValueStore ) + private GenericStore attributeValueStore; + + public void setAttributeValueStore( GenericStore attributeValueStore ) { this.attributeValueStore = attributeValueStore; } === removed file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/attribute/hibernate/HibernateAttributeValueStore.java' --- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/attribute/hibernate/HibernateAttributeValueStore.java 2011-09-06 11:52:18 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/attribute/hibernate/HibernateAttributeValueStore.java 1970-01-01 00:00:00 +0000 @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2004-2010, 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. - */ - -package org.hisp.dhis.attribute.hibernate; - -import org.hisp.dhis.attribute.AttributeValue; -import org.hisp.dhis.attribute.AttributeValueStore; -import org.hisp.dhis.hibernate.HibernateGenericStore; - -/** - * @author mortenoh - */ -public class HibernateAttributeValueStore - extends HibernateGenericStore - implements AttributeValueStore -{ - -} === modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml 2011-12-07 14:19:06 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml 2011-12-09 18:58:11 +0000 @@ -243,11 +243,13 @@ + - + + === modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/attribute/AttributeValueStoreTest.java' --- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/attribute/AttributeValueStoreTest.java 2011-09-21 15:53:54 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/attribute/AttributeValueStoreTest.java 2011-12-09 18:58:11 +0000 @@ -27,21 +27,23 @@ import static org.junit.Assert.*; import org.hisp.dhis.DhisSpringTest; +import org.hisp.dhis.common.GenericStore; public class AttributeValueStoreTest extends DhisSpringTest { - private AttributeValueStore attributeValueStore; + private GenericStore attributeValueStore; private AttributeValue attributeValue1; private AttributeValue attributeValue2; @Override + @SuppressWarnings("unchecked") protected void setUpTest() { AttributeStore attributeStore = (AttributeStore) getBean( "org.hisp.dhis.attribute.AttributeStore" ); - attributeValueStore = (AttributeValueStore) getBean( "org.hisp.dhis.attribute.AttributeValueStore" ); + attributeValueStore = (GenericStore) getBean( "org.hisp.dhis.attribute.AttributeValueStore" ); Attribute attribute1 = new Attribute(); attribute1.setName( "attribute_simple" );