← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14085: Made User.apps persistent

 

------------------------------------------------------------
revno: 14085
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-02-21 10:50:25 +0100
message:
  Made User.apps persistent
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java
  dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/User.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-api/src/main/java/org/hisp/dhis/user/User.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java	2014-02-19 10:28:50 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/user/User.java	2014-02-21 09:50:25 +0000
@@ -117,7 +117,7 @@
      */
     private Set<AttributeValue> attributeValues = new HashSet<AttributeValue>();
 
-    private List<String> apps = new ArrayList<String>(); //TODO not yet in use
+    private List<String> apps = new ArrayList<String>();
     
     // -------------------------------------------------------------------------
     // Logic

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/User.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/User.hbm.xml	2014-02-19 09:12:17 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/User.hbm.xml	2014-02-21 09:50:25 +0000
@@ -77,6 +77,13 @@
       <key column="userinfoid" />
       <many-to-many class="org.hisp.dhis.attribute.AttributeValue" column="attributevalueid" unique="true" />
     </set>
+    
+    <list name="apps" table="userapps">
+      <cache usage="read-write" />
+      <key column="userinfoid" foreign-key="fk_userapps_userinfoid" />
+      <list-index column="sort_order" base="0" />
+      <element type="string" column="app" />
+    </list>    
 
   </class>
 </hibernate-mapping>

=== 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-02-19 09:12:17 +0000
+++ dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/ehcache.xml	2014-02-21 09:50:25 +0000
@@ -305,6 +305,8 @@
   <cache name="org.hisp.dhis.user.User.attributeValues" maxElementsInMemory="1000" />
 
   <cache name="org.hisp.dhis.user.User.groups" maxElementsInMemory="1000" />
+  
+  <cache name="org.hisp.dhis.user.User.apps" maxElementsInMemory="1000" />
 
   <cache name="org.hisp.dhis.user.UserGroup.attributeValues" maxElementsInMemory="200" />