← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8823: Changed Map.mapViews from Set to List

 

------------------------------------------------------------
revno: 8823
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-11-01 16:40:28 +0300
message:
  Changed Map.mapViews from Set to List
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/Map.java
  dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/mapping/hibernate/Map.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/mapping/Map.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/Map.java	2012-10-31 06:11:09 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/Map.java	2012-11-01 13:40:28 +0000
@@ -27,8 +27,8 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.util.HashSet;
-import java.util.Set;
+import java.util.ArrayList;
+import java.util.List;
 
 import org.hisp.dhis.common.BaseIdentifiableObject;
 import org.hisp.dhis.common.Dxf2Namespace;
@@ -61,7 +61,7 @@
     private Integer zoom;
 
     @Scanned
-    private Set<MapView> mapViews = new HashSet<MapView>();
+    private List<MapView> mapViews = new ArrayList<MapView>();
 
     // -------------------------------------------------------------------------
     // Constructors
@@ -141,12 +141,12 @@
     @JsonView( {DetailedView.class, ExportView.class} )
     @JacksonXmlElementWrapper( localName = "mapViews", namespace = Dxf2Namespace.NAMESPACE )
     @JacksonXmlProperty( localName = "mapView", namespace = Dxf2Namespace.NAMESPACE )
-    public Set<MapView> getMapViews()
+    public List<MapView> getMapViews()
     {
         return mapViews;
     }
 
-    public void setMapViews( Set<MapView> mapViews )
+    public void setMapViews( List<MapView> mapViews )
     {
         this.mapViews = mapViews;
     }

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/mapping/hibernate/Map.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/mapping/hibernate/Map.hbm.xml	2012-10-31 06:11:09 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/mapping/hibernate/Map.hbm.xml	2012-11-01 13:40:28 +0000
@@ -8,6 +8,8 @@
 <hibernate-mapping>
   <class name="org.hisp.dhis.mapping.Map" table="map">
 
+    <cache usage="read-write" />
+
     <id name="id" column="mapid">
       <generator class="native" />
     </id>
@@ -27,10 +29,13 @@
     
     <property name="zoom" />
     
-    <set name="mapViews" table="mapmapviews">
+    <list name="mapViews" table="mapmapviews">
+      <cache usage="read-write" />
       <key column="mapid" foreign-key="fk_mapmapview_mapid" />
-      <many-to-many column="mapviewid" class="org.hisp.dhis.mapping.MapView" foreign-key="fk_mapmapview_mapviewid" />
-    </set>
+      <list-index column="sort_order" base="0" />
+      <many-to-many column="mapviewid" class="org.hisp.dhis.mapping.MapView" 
+        foreign-key="fk_mapmapview_mapviewid" />
+    </list>
     
   </class>
 </hibernate-mapping>
\ No newline at end of file

=== 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	2012-10-25 12:38:20 +0000
+++ dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/ehcache.xml	2012-11-01 13:40:28 +0000
@@ -186,7 +186,7 @@
   
   <cache name="org.hisp.dhis.chart.Chart.dataSets" maxElementsInMemory="200" />
 
-  <cache name="org.hisp.dhis.mapping.Map.views" maxElementsInMemory="1000" />
+  <cache name="org.hisp.dhis.mapping.Map.mapViews" maxElementsInMemory="1000" />
 
   <cache name="org.hisp.dhis.user.User.organisationUnits" maxElementsInMemory="20000" />