← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 970: Replaced OrganisationUnitGroupStore with generic store.

 

------------------------------------------------------------
revno: 970
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Tue 2009-11-03 15:44:26 +0100
message:
  Replaced OrganisationUnitGroupStore with generic store.
removed:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupStore.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/hibernate/HibernateOrganisationUnitGroupStore.java
added:
  dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupSetStoreTest.java
  dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupStoreTest.java
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitGroupService.java
  dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/IndicatorGroupSetConverter.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/IndicatorGroupSetMemberConverter.java
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/service/DefaultImportObjectManager.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-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupStore.java	2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupStore.java	1970-01-01 00:00:00 +0000
@@ -1,171 +0,0 @@
-package org.hisp.dhis.organisationunit;
-
-/*
- * Copyright (c) 2004-2007, 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.Collection;
-
-/**
- * Defines methods for persisting OrganisationUnitGroups and
- * OrganisationUnitGroupSets.
- * 
- * @author Torgeir Lorange Ostby
- * @version $Id: OrganisationUnitGroupStore.java 3286 2007-05-07 18:05:21Z larshelg $
- */
-public interface OrganisationUnitGroupStore
-{
-    String ID = OrganisationUnitGroupStore.class.getName();
-
-    // -------------------------------------------------------------------------
-    // OrganisationUnitGroup
-    // -------------------------------------------------------------------------
-
-    /**
-     * Adds an OrganisationUnitGroup.
-     * 
-     * @param organisationUnitGroup the OrganisationUnitGroup to add.
-     * @return a generated unique id of the added OrganisationUnitGroup.
-     */
-    int addOrganisationUnitGroup( OrganisationUnitGroup organisationUnitGroup );
-
-    /**
-     * Updates an OrganisationUnitGroup.
-     * 
-     * @param organisationUnitGroup the OrganisationUnitGroup to update.
-     */
-    void updateOrganisationUnitGroup( OrganisationUnitGroup organisationUnitGroup );
-
-    /**
-     * Deletes an OrganisationUnitGroup.
-     * 
-     * @param organisationUnitGroup the OrganisationUnitGroup to delete.
-     */
-    void deleteOrganisationUnitGroup( OrganisationUnitGroup organisationUnitGroup );
-
-    /**
-     * Returns an OrganisationUnitGroup.
-     * 
-     * @param id the id of the OrganisationUnitGroup.
-     * @return the OrganisationGroup with the given id, or null if no match.
-     */
-    OrganisationUnitGroup getOrganisationUnitGroup( int id );
-
-    /**
-     * Returns the OrganisationUnitGroup with the given UUID.
-     * 
-     * @param uuid the UUID of the OrganisationUnitGroup to return.
-     * @return the OrganisationUnitGroup with the given UUID, or null if no match.
-     */
-    OrganisationUnitGroup getOrganisationUnitGroup( String uuid );
-
-    /**
-     * Returns an OrganisationUnitGroup with a given name.
-     * 
-     * @param name the name of the OrganisationUnitGroup.
-     * @return the OrganisationUnitGroup with the given name, or null if no
-     *         match.
-     */
-    OrganisationUnitGroup getOrganisationUnitGroupByName( String name );
-
-    /**
-     * Returns all OrganisationUnitGroups.
-     * 
-     * @return a collection of all the OrganisationUnitGroups, or an empty
-     *         collection if no OrganisationUnitGroup exists.
-     */
-    Collection<OrganisationUnitGroup> getAllOrganisationUnitGroups();
-
-    // -------------------------------------------------------------------------
-    // OrganisationUnitGroupSet
-    // -------------------------------------------------------------------------
-
-    /**
-     * Adds an OrganisationUnitGroupSet.
-     * 
-     * @param organisationUnitGroupSet the OrganisationUnitGroupSet to add.
-     * @return the generated unique id of the added OrganisationUnitGroupSet.
-     */
-    int addOrganisationUnitGroupSet( OrganisationUnitGroupSet organisationUnitGroupSet );
-
-    /**
-     * Updates an OrganisationUnitGroupSet.
-     * 
-     * @param organisationUnitGroupSet the OrganisationUnitGroupSet to update.
-     */
-    void updateOrganisationUnitGroupSet( OrganisationUnitGroupSet organisationUnitGroupSet );
-
-    /**
-     * Deletes an OrganisationUnitGroupSet.
-     * 
-     * @param organisationUnitGroupSet the OrganisationUnitGroupSet to delete.
-     */
-    void deleteOrganisationUnitGroupSet( OrganisationUnitGroupSet organisationUnitGroupSet );
-
-    /**
-     * Returns an OrganisationUnitGroupSet.
-     * 
-     * @param id the id of the OrganisationUnitGroupSet to return.
-     * @return the OrganisationUnitGroupSet with the given id, or null if no
-     *         match.
-     */
-    OrganisationUnitGroupSet getOrganisationUnitGroupSet( int id );
-
-    /**
-     * Returns an OrganisationUnitGroupSet with a given name.
-     * 
-     * @param name the name of the OrganisationUnitGroupSet to return.
-     * @return the OrganisationUnitGroupSet with the given name, or null if no
-     *         match.
-     */
-    OrganisationUnitGroupSet getOrganisationUnitGroupSetByName( String name );
-
-    /**
-     * Returns all OrganisationUnitGroupSets.
-     * 
-     * @return a collection of all OrganisationUnitGroupSets, or an empty
-     *         collection if no OrganisationUnitGroupSet exists.
-     */
-    Collection<OrganisationUnitGroupSet> getAllOrganisationUnitGroupSets();
-
-    /**
-     * Returns all compulsory OrganisationUnitGroupSets.
-     * 
-     * @return a collection of all compulsory OrganisationUnitGroupSets, or an
-     *         empty collection if there are no compulsory
-     *         OrganisationUnitGroupSets.
-     */
-    Collection<OrganisationUnitGroupSet> getCompulsoryOrganisationUnitGroupSets();
-
-    /**
-     * Returns all exclusive OrganisationUnitGroupSets.
-     * 
-     * @return a collection of all exclusive OrganisationUnitGroupSets, or an
-     *         empty collection if there are no exclusive
-     *         OrganisationUnitGroupSets.
-     */
-    Collection<OrganisationUnitGroupSet> getExclusiveOrganisationUnitGroupSets();
-}

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitGroupService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitGroupService.java	2009-11-03 14:25:59 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/DefaultOrganisationUnitGroupService.java	2009-11-03 14:44:26 +0000
@@ -27,6 +27,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+import org.hisp.dhis.common.GenericIdentifiableObjectStore;
 import org.hisp.dhis.i18n.I18nService;
 import org.hisp.dhis.system.util.UUIdUtils;
 import org.springframework.transaction.annotation.Transactional;
@@ -47,12 +48,19 @@
     // Dependencies
     // -------------------------------------------------------------------------
 
-    private OrganisationUnitGroupStore organisationUnitGroupStore;
+    private GenericIdentifiableObjectStore<OrganisationUnitGroup> organisationUnitGroupStore;
 
-    public void setOrganisationUnitGroupStore( OrganisationUnitGroupStore organisationUnitGroupStore )
+    public void setOrganisationUnitGroupStore( GenericIdentifiableObjectStore<OrganisationUnitGroup> organisationUnitGroupStore )
     {
         this.organisationUnitGroupStore = organisationUnitGroupStore;
     }
+    
+    private GenericIdentifiableObjectStore<OrganisationUnitGroupSet> organisationUnitGroupSetStore;
+
+    public void setOrganisationUnitGroupSetStore( GenericIdentifiableObjectStore<OrganisationUnitGroupSet> organisationUnitGroupSetStore )
+    {
+        this.organisationUnitGroupSetStore = organisationUnitGroupSetStore;
+    }
 
     private I18nService i18nService;
 
@@ -72,7 +80,7 @@
             organisationUnitGroup.setUuid( UUIdUtils.getUUId() );
         }
         
-        int id = organisationUnitGroupStore.addOrganisationUnitGroup( organisationUnitGroup );
+        int id = organisationUnitGroupStore.save( organisationUnitGroup );
         
         i18nService.addObject( organisationUnitGroup );
         
@@ -81,7 +89,7 @@
 
     public void updateOrganisationUnitGroup( OrganisationUnitGroup organisationUnitGroup )
     {
-        organisationUnitGroupStore.updateOrganisationUnitGroup( organisationUnitGroup );
+        organisationUnitGroupStore.update( organisationUnitGroup );
         
         i18nService.verify( organisationUnitGroup );
     }
@@ -90,12 +98,12 @@
     {
         i18nService.removeObject( organisationUnitGroup );
         
-        organisationUnitGroupStore.deleteOrganisationUnitGroup( organisationUnitGroup );
+        organisationUnitGroupStore.delete( organisationUnitGroup );
     }
 
     public OrganisationUnitGroup getOrganisationUnitGroup( int id )
     {
-        return organisationUnitGroupStore.getOrganisationUnitGroup( id );
+        return organisationUnitGroupStore.get( id );
     }
     
     public Collection<OrganisationUnitGroup> getOrganisationUnitGroups( Collection<Integer> identifiers )
@@ -117,17 +125,17 @@
 
     public OrganisationUnitGroup getOrganisationUnitGroup( String uuid )
     {
-        return organisationUnitGroupStore.getOrganisationUnitGroup( uuid );
+        return organisationUnitGroupStore.getByUuid( uuid );
     }
 
     public OrganisationUnitGroup getOrganisationUnitGroupByName( String name )
     {
-        return organisationUnitGroupStore.getOrganisationUnitGroupByName( name );
+        return organisationUnitGroupStore.getByName( name );
     }
 
     public Collection<OrganisationUnitGroup> getAllOrganisationUnitGroups()
     {
-        return organisationUnitGroupStore.getAllOrganisationUnitGroups();
+        return organisationUnitGroupStore.getAll();
     }
 
     // -------------------------------------------------------------------------
@@ -136,7 +144,7 @@
 
     public int addOrganisationUnitGroupSet( OrganisationUnitGroupSet organisationUnitGroupSet )
     {
-        int id = organisationUnitGroupStore.addOrganisationUnitGroupSet( organisationUnitGroupSet );
+        int id = organisationUnitGroupSetStore.save( organisationUnitGroupSet );
         
         i18nService.addObject( organisationUnitGroupSet );
         
@@ -145,7 +153,7 @@
 
     public void updateOrganisationUnitGroupSet( OrganisationUnitGroupSet organisationUnitGroupSet )
     {
-        organisationUnitGroupStore.updateOrganisationUnitGroupSet( organisationUnitGroupSet );
+        organisationUnitGroupSetStore.update( organisationUnitGroupSet );
         
         i18nService.verify( organisationUnitGroupSet );
     }
@@ -154,12 +162,12 @@
     {
         i18nService.removeObject( organisationUnitGroupSet );
         
-        organisationUnitGroupStore.deleteOrganisationUnitGroupSet( organisationUnitGroupSet );
+        organisationUnitGroupSetStore.delete( organisationUnitGroupSet );
     }
 
     public OrganisationUnitGroupSet getOrganisationUnitGroupSet( int id )
     {
-        return organisationUnitGroupStore.getOrganisationUnitGroupSet( id );
+        return organisationUnitGroupSetStore.get( id );
     }
     
     public Collection<OrganisationUnitGroupSet> getOrganisationUnitGroupSets( Collection<Integer> identifiers )
@@ -181,22 +189,42 @@
 
     public OrganisationUnitGroupSet getOrganisationUnitGroupSetByName( String name )
     {
-        return organisationUnitGroupStore.getOrganisationUnitGroupSetByName( name );
+        return organisationUnitGroupSetStore.getByName( name );
     }
 
     public Collection<OrganisationUnitGroupSet> getAllOrganisationUnitGroupSets()
     {
-        return organisationUnitGroupStore.getAllOrganisationUnitGroupSets();
+        return organisationUnitGroupSetStore.getAll();
     }
 
     public Collection<OrganisationUnitGroupSet> getCompulsoryOrganisationUnitGroupSets()
     {
-        return organisationUnitGroupStore.getCompulsoryOrganisationUnitGroupSets();
+        Collection<OrganisationUnitGroupSet> groupSets = new ArrayList<OrganisationUnitGroupSet>();
+        
+        for ( OrganisationUnitGroupSet groupSet : getAllOrganisationUnitGroupSets() )
+        {
+            if ( groupSet.isCompulsory() )
+            {
+                groupSets.add( groupSet );
+            }
+        }
+        
+        return groupSets;
     }
 
     public Collection<OrganisationUnitGroupSet> getExclusiveOrganisationUnitGroupSets()
     {
-        return organisationUnitGroupStore.getExclusiveOrganisationUnitGroupSets();
+        Collection<OrganisationUnitGroupSet> groupSets = new ArrayList<OrganisationUnitGroupSet>();
+        
+        for ( OrganisationUnitGroupSet groupSet : getAllOrganisationUnitGroupSets() )
+        {
+            if ( groupSet.isExclusive() )
+            {
+                groupSets.add( groupSet );
+            }
+        }
+        
+        return groupSets;
     }
 
     public Collection<OrganisationUnitGroupSet> getExclusiveOrganisationUnitGroupSetsContainingGroup(

=== removed file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/hibernate/HibernateOrganisationUnitGroupStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/hibernate/HibernateOrganisationUnitGroupStore.java	2009-11-03 14:25:59 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/hibernate/HibernateOrganisationUnitGroupStore.java	1970-01-01 00:00:00 +0000
@@ -1,193 +0,0 @@
-package org.hisp.dhis.organisationunit.hibernate;
-
-/*
- * Copyright (c) 2004-2007, 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.Collection;
-
-import org.hibernate.Criteria;
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.hibernate.criterion.Restrictions;
-import org.hisp.dhis.organisationunit.OrganisationUnitGroup;
-import org.hisp.dhis.organisationunit.OrganisationUnitGroupSet;
-import org.hisp.dhis.organisationunit.OrganisationUnitGroupStore;
-
-/**
- * @author Torgeir Lorange Ostby
- * @version $Id: HibernateOrganisationUnitGroupStore.java 3286 2007-05-07 18:05:21Z larshelg $
- */
-public class HibernateOrganisationUnitGroupStore
-    implements OrganisationUnitGroupStore
-{
-    // -------------------------------------------------------------------------
-    // Dependencies
-    // -------------------------------------------------------------------------
-
-    private SessionFactory sessionFactory;
-
-    public void setSessionFactory( SessionFactory sessionFactory )
-    {
-        this.sessionFactory = sessionFactory;
-    }
-
-    // -------------------------------------------------------------------------
-    // OrganisationUnitGroup
-    // -------------------------------------------------------------------------
-
-    public int addOrganisationUnitGroup( OrganisationUnitGroup organisationUnitGroup )
-    {
-        Session session = sessionFactory.getCurrentSession();
-
-        return (Integer) session.save( organisationUnitGroup );
-    }
-
-    public void updateOrganisationUnitGroup( OrganisationUnitGroup organisationUnitGroup )
-    {
-        Session session = sessionFactory.getCurrentSession();
-
-        session.update( organisationUnitGroup );
-    }
-
-    public void deleteOrganisationUnitGroup( OrganisationUnitGroup organisationUnitGroup )
-    {
-        Session session = sessionFactory.getCurrentSession();
-
-        session.delete( organisationUnitGroup );
-    }
-
-    public OrganisationUnitGroup getOrganisationUnitGroup( int id )
-    {
-        Session session = sessionFactory.getCurrentSession();
-
-        return (OrganisationUnitGroup) session.get( OrganisationUnitGroup.class, id );
-    }
-
-    public OrganisationUnitGroup getOrganisationUnitGroup( String uuid )
-    {
-        Session session = sessionFactory.getCurrentSession();
-        
-        Criteria criteria = session.createCriteria( OrganisationUnitGroup.class );
-        criteria.add( Restrictions.eq( "uuid", uuid ) );
-        
-        return (OrganisationUnitGroup) criteria.uniqueResult();                
-    }
-
-    public OrganisationUnitGroup getOrganisationUnitGroupByName( String name )
-    {
-        Session session = sessionFactory.getCurrentSession();
-
-        Criteria criteria = session.createCriteria( OrganisationUnitGroup.class );
-        criteria.add( Restrictions.eq( "name", name ) );
-
-        return (OrganisationUnitGroup) criteria.uniqueResult();
-    }
-
-    @SuppressWarnings( "unchecked" )
-    public Collection<OrganisationUnitGroup> getAllOrganisationUnitGroups()
-    {
-        Session session = sessionFactory.getCurrentSession();
-
-        Criteria criteria = session.createCriteria( OrganisationUnitGroup.class );
-
-        return criteria.list();
-    }
-
-    // -------------------------------------------------------------------------
-    // OrganisationUnitGroupSet
-    // -------------------------------------------------------------------------
-
-    public int addOrganisationUnitGroupSet( OrganisationUnitGroupSet organisationUnitGroupSet )
-    {
-        Session session = sessionFactory.getCurrentSession();
-
-        return (Integer) session.save( organisationUnitGroupSet );
-    }
-
-    public void updateOrganisationUnitGroupSet( OrganisationUnitGroupSet organisationUnitGroupSet )
-    {
-        Session session = sessionFactory.getCurrentSession();
-
-        session.update( organisationUnitGroupSet );
-    }
-
-    public void deleteOrganisationUnitGroupSet( OrganisationUnitGroupSet organisationUnitGroupSet )
-    {
-        Session session = sessionFactory.getCurrentSession();
-
-        session.delete( organisationUnitGroupSet );
-    }
-
-    public OrganisationUnitGroupSet getOrganisationUnitGroupSet( int id )
-    {
-        Session session = sessionFactory.getCurrentSession();
-
-        return (OrganisationUnitGroupSet) session.get( OrganisationUnitGroupSet.class, id );
-    }
-
-    public OrganisationUnitGroupSet getOrganisationUnitGroupSetByName( String name )
-    {
-        Session session = sessionFactory.getCurrentSession();
-
-        Criteria criteria = session.createCriteria( OrganisationUnitGroupSet.class );
-        criteria.add( Restrictions.eq( "name", name ) );
-
-        return (OrganisationUnitGroupSet) criteria.uniqueResult();
-    }
-
-    @SuppressWarnings( "unchecked" )
-    public Collection<OrganisationUnitGroupSet> getAllOrganisationUnitGroupSets()
-    {
-        Session session = sessionFactory.getCurrentSession();
-
-        Criteria criteria = session.createCriteria( OrganisationUnitGroupSet.class );
-
-        return criteria.list();
-    }
-
-    @SuppressWarnings( "unchecked" )
-    public Collection<OrganisationUnitGroupSet> getCompulsoryOrganisationUnitGroupSets()
-    {
-        Session session = sessionFactory.getCurrentSession();
-
-        Criteria criteria = session.createCriteria( OrganisationUnitGroupSet.class );
-        criteria.add( Restrictions.eq( "compulsory", true ) );
-
-        return criteria.list();
-    }
-
-    @SuppressWarnings( "unchecked" )
-    public Collection<OrganisationUnitGroupSet> getExclusiveOrganisationUnitGroupSets()
-    {
-        Session session = sessionFactory.getCurrentSession();
-
-        Criteria criteria = session.createCriteria( OrganisationUnitGroupSet.class );
-        criteria.add( Restrictions.eq( "exclusive", true ) );
-
-        return criteria.list();
-    }
-}

=== 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	2009-11-03 14:24:13 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/META-INF/dhis/beans.xml	2009-11-03 14:44:26 +0000
@@ -159,7 +159,14 @@
   </bean>
 
   <bean id="org.hisp.dhis.organisationunit.OrganisationUnitGroupStore"
-    class="org.hisp.dhis.organisationunit.hibernate.HibernateOrganisationUnitGroupStore">
+    class="org.hisp.dhis.hibernate.HibernateGenericStore">
+    <property name="clazz" value="org.hisp.dhis.organisationunit.OrganisationUnitGroup"/>
+    <property name="sessionFactory" ref="sessionFactory"/>
+  </bean>
+  
+  <bean id="org.hisp.dhis.organisationunit.OrganisationUnitGroupSetStore"
+    class="org.hisp.dhis.hibernate.HibernateGenericStore">
+    <property name="clazz" value="org.hisp.dhis.organisationunit.OrganisationUnitGroupSet"/>
     <property name="sessionFactory" ref="sessionFactory"/>
   </bean>
   
@@ -315,6 +322,8 @@
     class="org.hisp.dhis.organisationunit.DefaultOrganisationUnitGroupService">
     <property name="organisationUnitGroupStore"
       ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupStore"/>
+    <property name="organisationUnitGroupSetStore"
+      ref="org.hisp.dhis.organisationunit.OrganisationUnitGroupSetStore"/>
     <property name="i18nService"
       ref="org.hisp.dhis.i18n.I18nService"/>
   </bean>

=== added file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupSetStoreTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupSetStoreTest.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupSetStoreTest.java	2009-11-03 14:44:26 +0000
@@ -0,0 +1,55 @@
+package org.hisp.dhis.organisationunit;
+
+/*
+ * Copyright (c) 2004-2007, 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.hisp.dhis.GenericDhisSpringTest;
+
+/**
+ * @author Lars Helge Overland
+ * @version $Id$
+ */
+public class OrganisationUnitGroupSetStoreTest
+    extends GenericDhisSpringTest<OrganisationUnitGroupSet>
+{
+    private OrganisationUnitGroupSet[] objects = {
+        createOrganisationUnitGroupSet( 'A' ),
+        createOrganisationUnitGroupSet( 'B' ),
+        createOrganisationUnitGroupSet( 'C' ) };
+
+    @Override
+    protected OrganisationUnitGroupSet[] getObjects()
+    {
+        return objects;
+    }    
+
+    @Override
+    protected String getGenericBeanId()
+    {
+        return "org.hisp.dhis.organisationunit.OrganisationUnitGroupSetStore";
+    }
+}

=== added file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupStoreTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupStoreTest.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/organisationunit/OrganisationUnitGroupStoreTest.java	2009-11-03 14:44:26 +0000
@@ -0,0 +1,55 @@
+package org.hisp.dhis.organisationunit;
+
+/*
+ * Copyright (c) 2004-2007, 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.hisp.dhis.GenericDhisSpringTest;
+
+/**
+ * @author Lars Helge Overland
+ * @version $Id$
+ */
+public class OrganisationUnitGroupStoreTest
+    extends GenericDhisSpringTest<OrganisationUnitGroup>
+{
+    private OrganisationUnitGroup[] objects = {
+        new OrganisationUnitGroup( "GroupA" ),
+        new OrganisationUnitGroup( "GroupB" ),
+        new OrganisationUnitGroup( "GroupC" ) };
+
+    @Override
+    protected OrganisationUnitGroup[] getObjects()
+    {
+        return objects;
+    }    
+
+    @Override
+    protected String getGenericBeanId()
+    {
+        return "org.hisp.dhis.organisationunit.OrganisationUnitGroupStore";
+    }
+}

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/IndicatorGroupSetConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/IndicatorGroupSetConverter.java	2009-11-01 21:32:55 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/IndicatorGroupSetConverter.java	2009-11-03 14:44:26 +0000
@@ -30,9 +30,9 @@
 import java.util.Collection;
 import java.util.Map;
 
+import org.amplecode.quick.BatchHandler;
 import org.amplecode.staxwax.reader.XMLReader;
 import org.amplecode.staxwax.writer.XMLWriter;
-import org.amplecode.quick.BatchHandler;
 import org.hisp.dhis.importexport.ExportParams;
 import org.hisp.dhis.importexport.GroupMemberType;
 import org.hisp.dhis.importexport.ImportObjectService;
@@ -40,7 +40,6 @@
 import org.hisp.dhis.importexport.XMLConverter;
 import org.hisp.dhis.importexport.converter.AbstractIndicatorGroupSetConverter;
 import org.hisp.dhis.importexport.mapping.NameMappingUtil;
-import org.hisp.dhis.indicator.IndicatorGroup;
 import org.hisp.dhis.indicator.IndicatorGroupSet;
 import org.hisp.dhis.indicator.IndicatorService;
 

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/IndicatorGroupSetMemberConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/IndicatorGroupSetMemberConverter.java	2009-11-02 11:56:51 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dxf/converter/IndicatorGroupSetMemberConverter.java	2009-11-03 14:44:26 +0000
@@ -41,7 +41,6 @@
 import org.hisp.dhis.importexport.ImportParams;
 import org.hisp.dhis.importexport.XMLConverter;
 import org.hisp.dhis.importexport.converter.AbstractGroupMemberConverter;
-import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.indicator.IndicatorGroup;
 import org.hisp.dhis.indicator.IndicatorGroupSet;
 import org.hisp.dhis.indicator.IndicatorService;

=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/service/DefaultImportObjectManager.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/service/DefaultImportObjectManager.java	2009-11-02 11:56:51 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/service/DefaultImportObjectManager.java	2009-11-03 14:44:26 +0000
@@ -204,6 +204,7 @@
         this.importDataValueService = importDataValueService;
     }
 
+    @SuppressWarnings( "unused" )
     private LockingManager lockingManager;
 
     public void setLockingManager( LockingManager lockingManager )