← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 13851: minor fixes to lastUpdated dep updater

 

------------------------------------------------------------
revno: 13851
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-01-27 10:27:46 +0700
message:
  minor fixes to lastUpdated dep updater
modified:
  dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/hibernate/HibernateEntityInterceptorWiring.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroup/AddOrganisationUnitGroupAction.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/hibernate/HibernateEntityInterceptorWiring.java'
--- dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/hibernate/HibernateEntityInterceptorWiring.java	2014-01-25 09:38:07 +0000
+++ dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/hibernate/HibernateEntityInterceptorWiring.java	2014-01-27 03:27:46 +0000
@@ -65,7 +65,7 @@
     private Set<IdentifiableObject> identifiableObjects = new HashSet<IdentifiableObject>();
 
     @PostConstruct
-    @SuppressWarnings( "unchecked" )
+    @SuppressWarnings("unchecked")
     public void registerListeners()
     {
         EventListenerRegistry registry = ((SessionFactoryImpl) sessionFactory).getServiceRegistry()
@@ -80,6 +80,7 @@
                 {
                     if ( event.getAffectedOwnerOrNull() instanceof IdentifiableObject )
                     {
+                        System.err.println( "is true: " + event.getAffectedOwnerEntityName() );
                         identifiableObjects.add( (IdentifiableObject) event.getAffectedOwnerOrNull() );
                     }
                 }
@@ -93,6 +94,16 @@
                 if ( Collection.class.isInstance( newValue ) )
                 {
                     newCol = new ArrayList( (Collection) newValue );
+
+                    if ( !newCol.isEmpty() )
+                    {
+                        Object next = newCol.iterator().next();
+
+                        if ( !(next instanceof IdentifiableObject) )
+                        {
+                            newCol = new ArrayList();
+                        }
+                    }
                 }
 
                 if ( Map.class.isInstance( oldValue ) )
@@ -138,7 +149,7 @@
                     return;
                 }
 
-                //objectManager.update( new ArrayList<IdentifiableObject>( identifiableObjects ) );
+                // objectManager.update( new ArrayList<IdentifiableObject>( identifiableObjects ) );
                 identifiableObjects.clear();
             }
         } );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroup/AddOrganisationUnitGroupAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroup/AddOrganisationUnitGroupAction.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunitgroup/AddOrganisationUnitGroupAction.java	2014-01-27 03:27:46 +0000
@@ -141,6 +141,8 @@
         organisationUnitGroup.setCode( code );
         organisationUnitGroup.setSymbol( symbol );
 
+        organisationUnitGroupService.addOrganisationUnitGroup( organisationUnitGroup );
+
         Collection<OrganisationUnit> selectedOrganisationUnits = selectionTreeManager
             .getReloadedSelectedOrganisationUnits();
 
@@ -163,7 +165,7 @@
             }
         }
 
-        organisationUnitGroupService.addOrganisationUnitGroup( organisationUnitGroup );
+        organisationUnitGroupService.updateOrganisationUnitGroup( organisationUnitGroup );
 
         return SUCCESS;
     }