← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14694: OrganisationUnitLevel, caching

 

------------------------------------------------------------
revno: 14694
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2014-04-06 11:44:34 +0200
message:
  OrganisationUnitLevel, caching
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/hibernate/HibernateOrganisationUnitLevelStore.java
  dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnitLevel.hbm.xml
  dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/ehcache.xml


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

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/hibernate/HibernateOrganisationUnitLevelStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/hibernate/HibernateOrganisationUnitLevelStore.java	2014-03-18 08:10:10 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/organisationunit/hibernate/HibernateOrganisationUnitLevelStore.java	2014-04-06 09:44:34 +0000
@@ -49,7 +49,7 @@
 
     public OrganisationUnitLevel getByLevel( int level )
     {
-        return (OrganisationUnitLevel) getCriteria().add( Restrictions.eq( "level", level ) ).uniqueResult();
+        return (OrganisationUnitLevel) getCriteria( Restrictions.eq( "level", level ) ).uniqueResult();
     }
 
     @Override

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnitLevel.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnitLevel.hbm.xml	2013-02-07 10:25:34 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnitLevel.hbm.xml	2014-04-06 09:44:34 +0000
@@ -8,6 +8,8 @@
 <hibernate-mapping>
   <class name="org.hisp.dhis.organisationunit.OrganisationUnitLevel" table="orgunitlevel">
 
+    <cache usage="read-write" />
+
     <id name="id" column="orgunitlevelid">
       <generator class="native" />
     </id>

=== modified file 'dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/ehcache.xml'
--- dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/ehcache.xml	2014-04-06 09:32:37 +0000
+++ dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/ehcache.xml	2014-04-06 09:44:34 +0000
@@ -75,6 +75,8 @@
   <cache name="org.hisp.dhis.organisationunit.OrganisationUnitGroupSet" maxElementsInMemory="50" />
 
   <cache name="org.hisp.dhis.organisationunit.OrganisationUnitGroupSet.attributeValues" maxElementsInMemory="1000" />
+  
+  <cache name="org.hisp.dhis.organisationunit.OrganisationUnitLevel" maxElementsInMemory="20" />
 
   <cache name="org.hisp.dhis.user.User" maxElementsInMemory="200" />