← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14370: add db sharing props for: SqlView, OptionSet, OrgUnitGroupSet, UserRole, ValidationRuleGroup, Tra...

 

------------------------------------------------------------
revno: 14370
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-03-24 19:52:45 +0100
message:
  add db sharing props for: SqlView, OptionSet, OrgUnitGroupSet, UserRole, ValidationRuleGroup, TrackedEntityAttribute
modified:
  dhis-2/dhis-services/dhis-service-administration/src/main/resources/org/hisp/dhis/sqlview/hibernate/SqlView.hbm.xml
  dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElement.hbm.xml
  dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/option/hibernate/OptionSet.hbm.xml
  dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnitGroupSet.hbm.xml
  dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/UserAuthorityGroup.hbm.xml
  dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/validation/hibernate/ValidationRuleGroup.hbm.xml
  dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/trackedentity/hibernate/TrackedEntityAttribute.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-administration/src/main/resources/org/hisp/dhis/sqlview/hibernate/SqlView.hbm.xml'
--- dhis-2/dhis-services/dhis-service-administration/src/main/resources/org/hisp/dhis/sqlview/hibernate/SqlView.hbm.xml	2013-06-05 12:02:23 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/resources/org/hisp/dhis/sqlview/hibernate/SqlView.hbm.xml	2014-03-24 18:52:45 +0000
@@ -1,9 +1,9 @@
 <?xml version="1.0"?>
 <!DOCTYPE hibernate-mapping PUBLIC
-    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
-    "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd";
-    [<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
-    >
+  "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+  "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd";
+  [<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
+  >
 
 <hibernate-mapping>
   <class name="org.hisp.dhis.sqlview.SqlView" table="sqlview">
@@ -19,5 +19,16 @@
 
     <property name="sqlQuery" not-null="true" type="text" />
 
+    <!-- Access properties -->
+    <many-to-one name="user" class="org.hisp.dhis.user.User" column="userid" foreign-key="fk_sqlview_userid" />
+
+    <property name="publicAccess" length="8" />
+
+    <set name="userGroupAccesses" table="sqlviewusergroupaccesses">
+      <cache usage="read-write" />
+      <key column="sqlviewid" />
+      <many-to-many class="org.hisp.dhis.user.UserGroupAccess" column="usergroupaccessid" unique="true" />
+    </set>
+
   </class>
 </hibernate-mapping>

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElement.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElement.hbm.xml	2014-03-11 11:20:40 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElement.hbm.xml	2014-03-24 18:52:45 +0000
@@ -80,7 +80,7 @@
       foreign-key="fk_dataelement_legendset" />
 
     <!-- Access properties -->
-    <many-to-one name="user" class="org.hisp.dhis.user.User" column="userid" foreign-key="fk_indicator_userid" />
+    <many-to-one name="user" class="org.hisp.dhis.user.User" column="userid" foreign-key="fk_dataelement_userid" />
 
     <property name="publicAccess" length="8" />
 

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/option/hibernate/OptionSet.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/option/hibernate/OptionSet.hbm.xml	2013-08-05 08:23:16 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/option/hibernate/OptionSet.hbm.xml	2014-03-24 18:52:45 +0000
@@ -26,5 +26,16 @@
       <element type="text" column="optionvalue" />
     </list>
 
+    <!-- Access properties -->
+    <many-to-one name="user" class="org.hisp.dhis.user.User" column="userid" foreign-key="fk_optionset_userid" />
+
+    <property name="publicAccess" length="8" />
+
+    <set name="userGroupAccesses" table="optionsetusergroupaccesses">
+      <cache usage="read-write" />
+      <key column="optionsetid" />
+      <many-to-many class="org.hisp.dhis.user.UserGroupAccess" column="usergroupaccessid" unique="true" />
+    </set>
+
   </class>
 </hibernate-mapping>

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnitGroupSet.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnitGroupSet.hbm.xml	2014-02-12 10:52:22 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnitGroupSet.hbm.xml	2014-03-24 18:52:45 +0000
@@ -38,5 +38,16 @@
       <many-to-many class="org.hisp.dhis.attribute.AttributeValue" column="attributevalueid" unique="true" />
     </set>
 
+    <!-- Access properties -->
+    <many-to-one name="user" class="org.hisp.dhis.user.User" column="userid" foreign-key="fk_orgunitgroupset_userid" />
+
+    <property name="publicAccess" length="8" />
+
+    <set name="userGroupAccesses" table="orgunitgroupsetusergroupaccesses">
+      <cache usage="read-write" />
+      <key column="orgunitgroupsetid" />
+      <many-to-many class="org.hisp.dhis.user.UserGroupAccess" column="usergroupaccessid" unique="true" />
+    </set>
+
   </class>
 </hibernate-mapping>

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/UserAuthorityGroup.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/UserAuthorityGroup.hbm.xml	2013-05-27 11:34:38 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/UserAuthorityGroup.hbm.xml	2014-03-24 18:52:45 +0000
@@ -35,5 +35,16 @@
       <many-to-many column="datasetid" class="org.hisp.dhis.dataset.DataSet" foreign-key="fk_userroledataset_datasetid" />
     </set>
 
+    <!-- Access properties -->
+    <many-to-one name="user" class="org.hisp.dhis.user.User" column="userid" foreign-key="fk_userrole_userid" />
+
+    <property name="publicAccess" length="8" />
+
+    <set name="userGroupAccesses" table="userroleusergroupaccesses">
+      <cache usage="read-write" />
+      <key column="userroleid" />
+      <many-to-many class="org.hisp.dhis.user.UserGroupAccess" column="usergroupaccessid" unique="true" />
+    </set>
+
   </class>
 </hibernate-mapping>

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/validation/hibernate/ValidationRuleGroup.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/validation/hibernate/ValidationRuleGroup.hbm.xml	2013-09-27 17:05:36 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/validation/hibernate/ValidationRuleGroup.hbm.xml	2014-03-24 18:52:45 +0000
@@ -31,5 +31,16 @@
         foreign-key="fk_validationrulegroupuserrolestoalert_userroleid" />
     </set>
 
+    <!-- Access properties -->
+    <many-to-one name="user" class="org.hisp.dhis.user.User" column="userid" foreign-key="fk_validationrulegroup_userid" />
+
+    <property name="publicAccess" length="8" />
+
+    <set name="userGroupAccesses" table="validationrulegroupusergroupaccesses">
+      <cache usage="read-write" />
+      <key column="validationrulegroupid" />
+      <many-to-many class="org.hisp.dhis.user.UserGroupAccess" column="usergroupaccessid" unique="true" />
+    </set>
+
   </class>
 </hibernate-mapping>

=== modified file 'dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/trackedentity/hibernate/TrackedEntityAttribute.hbm.xml'
--- dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/trackedentity/hibernate/TrackedEntityAttribute.hbm.xml	2014-03-20 15:05:57 +0000
+++ dhis-2/dhis-services/dhis-service-tracker/src/main/resources/org/hisp/dhis/trackedentity/hibernate/TrackedEntityAttribute.hbm.xml	2014-03-24 18:52:45 +0000
@@ -19,10 +19,11 @@
 
     <property name="valueType" column="valuetype" not-null="true" />
 
-    <many-to-one name="attributeGroup" column="trackedentityattributegroupid" class="org.hisp.dhis.trackedentity.TrackedEntityAttributeGroup"
+    <many-to-one name="attributeGroup" column="trackedentityattributegroupid"
+      class="org.hisp.dhis.trackedentity.TrackedEntityAttributeGroup"
       foreign-key="fk_attribute_group" />
 
-   <many-to-one name="optionSet" class="org.hisp.dhis.option.OptionSet" column="optionsetid"
+    <many-to-one name="optionSet" class="org.hisp.dhis.option.OptionSet" column="optionsetid"
       foreign-key="fk_trackedentityattribute_optionsetid" />
 
     <property name="inherit" column="inherit" />
@@ -32,17 +33,28 @@
     <property name="displayOnVisitSchedule" />
 
     <property name="sortOrderInVisitSchedule" />
-    
+
     <property name="displayInListNoProgram" />
-    
-    <property name="unique" column="uniquefield"/>
-    
+
+    <property name="unique" column="uniquefield" />
+
     <property name="orgunitScope" />
 
     <property name="programScope" />
-    
+
     <many-to-one name="periodType" class="org.hisp.dhis.period.PeriodType" column="periodtypeid"
-      	foreign-key="fk_trackedentityattribute_periodtypeid" />
-	
+      foreign-key="fk_trackedentityattribute_periodtypeid" />
+
+    <!-- Access properties -->
+    <many-to-one name="user" class="org.hisp.dhis.user.User" column="userid" foreign-key="fk_trackedentityattribute_userid" />
+
+    <property name="publicAccess" length="8" />
+
+    <set name="userGroupAccesses" table="trackedentityattributeusergroupaccesses">
+      <cache usage="read-write" />
+      <key column="trackedentityattributeid" />
+      <many-to-many class="org.hisp.dhis.user.UserGroupAccess" column="usergroupaccessid" unique="true" />
+    </set>
+
   </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-03-11 11:20:40 +0000
+++ dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/ehcache.xml	2014-03-24 18:52:45 +0000
@@ -25,11 +25,11 @@
   <cache name="org.hisp.dhis.dataelement.DataElementCategoryOption" maxElementsInMemory="400" />
 
   <cache name="org.hisp.dhis.dataelement.DataElementCategoryOptionCombo" maxElementsInMemory="800" />
-  
+
   <cache name="org.hisp.dhis.dataelement.CategoryOptionGroup" maxElementsInMemory="1000" />
-  
-  <cache name="org.hisp.dhis.dataelement.CategoryOptionGroupSet" maxElementsInMemory="50" />  
-  
+
+  <cache name="org.hisp.dhis.dataelement.CategoryOptionGroupSet" maxElementsInMemory="50" />
+
   <cache name="org.hisp.dhis.dataelement.DataElementCategoryDimension" maxElementsInMemory="2000" />
 
   <cache name="org.hisp.dhis.dataelement.DataElementGroup" maxElementsInMemory="200" />
@@ -51,7 +51,7 @@
   <cache name="org.hisp.dhis.period.Period" maxElementsInMemory="200" />
 
   <cache name="org.hisp.dhis.period.PeriodType" maxElementsInMemory="50" />
-  
+
   <cache name="org.hisp.dhis.period.RelativePeriods" maxElementsInMemory="30" />
 
   <cache name="org.hisp.dhis.dataset.DataSet" maxElementsInMemory="400" />
@@ -119,15 +119,19 @@
   <cache name="org.hisp.dhis.attribute.AttributeValue" maxElementsInMemory="5000" />
 
   <cache name="org.hisp.dhis.option.OptionSet" maxElementsInMemory="50" />
-  
+
   <cache name="org.hisp.dhis.dataset.LockException" maxElementsInMemory="1000" />
 
   <cache name="org.hisp.dhis.filter.MetaDataFilter" maxElementsInMemory="100" />
-  
+
   <cache name="org.hisp.dhis.program.Program" maxElementsInMemory="100" />
-  
+
   <cache name="org.hisp.dhis.program.ProgramStage" maxElementsInMemory="500" />
 
+  <cache name="org.hisp.dhis.sqlview.SqlView" maxElementsInMemory="50" />
+
+  <cache name="org.hisp.dhis.trackedentity.TrackedEntityAttribute" maxElementsInMemory="50" />
+
   <!-- Hibernate Associations -->
 
   <cache name="org.hisp.dhis.dataelement.DataElementCategoryCombo.categories" maxElementsInMemory="300" />
@@ -143,19 +147,19 @@
   <cache name="org.hisp.dhis.dataelement.DataElementCategoryOption.categoryOptionCombos" maxElementsInMemory="500" />
 
   <cache name="org.hisp.dhis.dataelement.DataElementCategoryOption.categories" maxElementsInMemory="300" />
-  
+
   <cache name="org.hisp.dhis.dataelement.DataElementCategoryOption.groups" maxElementsInMemory="300" />
 
   <cache name="org.hisp.dhis.dataelement.DataElementCategoryOption.userGroupAccesses" maxElementsInMemory="300" />
 
   <cache name="org.hisp.dhis.dataelement.DataElementCategoryOptionCombo.categoryOptions" maxElementsInMemory="500" />
-  
+
   <cache name="org.hisp.dhis.dataelement.CategoryOptionGroup.userGroupAccesses" maxElementsInMemory="500" />
-  
+
   <cache name="org.hisp.dhis.dataelement.CategoryOptionGroup.members" maxElementsInMemory="500" />
-  
+
   <cache name="org.hisp.dhis.dataelement.CategoryOptionGroupSet.members" maxElementsInMemory="500" />
-  
+
   <cache name="org.hisp.dhis.dataelement.CategoryOptionGroupSet.userGroupAccesses" maxElementsInMemory="500" />
 
   <cache name="org.hisp.dhis.dataelement.DataElementCategoryDimension.items" maxElementsInMemory="500" />
@@ -187,7 +191,7 @@
   <cache name="org.hisp.dhis.dataelement.DataElementGroupSet.members" maxElementsInMemory="500" />
 
   <cache name="org.hisp.dhis.dataelement.DataElementGroupSet.userGroupAccesses" maxElementsInMemory="500" />
-  
+
   <cache name="org.hisp.dhis.document.Document.userGroupAccesses" maxElementsInMemory="100" />
 
   <cache name="org.hisp.dhis.indicator.Indicator.groups" maxElementsInMemory="500" />
@@ -232,6 +236,8 @@
 
   <cache name="org.hisp.dhis.organisationunit.OrganisationUnitGroupSet.organisationUnitGroups" maxElementsInMemory="500" />
 
+  <cache name="org.hisp.dhis.organisationunit.OrganisationUnitGroupSet.userGroupAccesses" maxElementsInMemory="200" />
+
   <cache name="org.hisp.dhis.report.Report.userGroupAccesses" maxElementsInMemory="200" />
 
   <cache name="org.hisp.dhis.reporttable.ReportTable.indicators" maxElementsInMemory="500" />
@@ -245,7 +251,7 @@
   <cache name="org.hisp.dhis.reporttable.ReportTable.periods" maxElementsInMemory="200" />
 
   <cache name="org.hisp.dhis.reporttable.ReportTable.organisationUnits" maxElementsInMemory="2000" />
-  
+
   <cache name="org.hisp.dhis.reporttable.ReportTable.dataElementGroups" maxElementsInMemory="500" />
 
   <cache name="org.hisp.dhis.reporttable.ReportTable.organisationUnitGroups" maxElementsInMemory="500" />
@@ -269,7 +275,7 @@
   <cache name="org.hisp.dhis.chart.Chart.indicators" maxElementsInMemory="500" />
 
   <cache name="org.hisp.dhis.chart.Chart.dataElements" maxElementsInMemory="1500" />
-  
+
   <cache name="org.hisp.dhis.chart.Chart.dataElementOperands" maxElementsInMemory="1500" />
 
   <cache name="org.hisp.dhis.chart.Chart.dataSets" maxElementsInMemory="200" />
@@ -277,23 +283,23 @@
   <cache name="org.hisp.dhis.chart.Chart.periods" maxElementsInMemory="200" />
 
   <cache name="org.hisp.dhis.chart.Chart.organisationUnits" maxElementsInMemory="2000" />
-  
+
   <cache name="org.hisp.dhis.chart.Chart.dataElementGroups" maxElementsInMemory="500" />
-  
+
   <cache name="org.hisp.dhis.chart.Chart.organisationUnitGroups" maxElementsInMemory="500" />
-  
+
   <cache name="org.hisp.dhis.chart.Chart.categoryOptionGroups" maxElementsInMemory="500" />
-  
+
   <cache name="org.hisp.dhis.chart.Chart.itemOrganisationUnitGroups" maxElementsInMemory="500" />
-  
+
   <cache name="org.hisp.dhis.chart.Chart.categoryDimensions" maxElementsInMemory="500" />
-  
+
   <cache name="org.hisp.dhis.chart.Chart.filterDimensions" maxElementsInMemory="500" />
-  
+
   <cache name="org.hisp.dhis.chart.Chart.organisationUnitLevels" maxElementsInMemory="500" />
-  
+
   <cache name="org.hisp.dhis.chart.Chart.userGroupAccesses" maxElementsInMemory="500" />
-  
+
   <cache name="org.hisp.dhis.mapping.Map.mapViews" maxElementsInMemory="1000" />
 
   <cache name="org.hisp.dhis.mapping.Map.userGroupAccesses" maxElementsInMemory="500" />
@@ -305,31 +311,33 @@
   <cache name="org.hisp.dhis.mapping.MapView.indicators" maxElementsInMemory="500" />
 
   <cache name="org.hisp.dhis.mapping.MapView.dataElements" maxElementsInMemory="1500" />
-  
+
   <cache name="org.hisp.dhis.mapping.MapView.dataElementOperands" maxElementsInMemory="1500" />
 
   <cache name="org.hisp.dhis.mapping.MapView.periods" maxElementsInMemory="200" />
 
   <cache name="org.hisp.dhis.mapping.MapView.organisationUnits" maxElementsInMemory="2000" />
-  
+
   <cache name="org.hisp.dhis.mapping.MapView.organisationUnitLevels" maxElementsInMemory="500" />
-  
+
   <cache name="org.hisp.dhis.mapping.MapView.itemOrganisationUnitGroups" maxElementsInMemory="500" />
-  
+
   <cache name="org.hisp.dhis.attribute.Attribute.attributeValues" maxElementsInMemory="5000" />
-  
+
   <cache name="org.hisp.dhis.option.OptionSet.options" maxElementsInMemory="2000" />
 
+  <cache name="org.hisp.dhis.option.OptionSet.userGroupAccesses" maxElementsInMemory="200" />
+
   <cache name="org.hisp.dhis.interpretation.Interpretation.userGroupAccesses" maxElementsInMemory="200" />
 
   <cache name="org.hisp.dhis.user.User.organisationUnits" maxElementsInMemory="20000" />
-  
+
   <cache name="org.hisp.dhis.user.User.dataViewOrganisationUnits" maxElementsInMemory="20000" />
 
   <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" />
@@ -340,4 +348,12 @@
 
   <cache name="org.hisp.dhis.user.UserAuthorityGroup.authorities" maxElementsInMemory="500" />
 
+  <cache name="org.hisp.dhis.user.UserAuthorityGroup.userGroupAccesses" maxElementsInMemory="200" />
+
+  <cache name="org.hisp.dhis.validation.ValidationRuleGroup.userGroupAccesses" maxElementsInMemory="200" />
+
+  <cache name="org.hisp.dhis.sqlview.SqlView.userGroupAccesses" maxElementsInMemory="200" />
+
+  <cache name="org.hisp.dhis.trackedentity.TrackedEntityAttribute.userGroupAccesses" maxElementsInMemory="200" />
+
 </ehcache>