← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 59: Added caching to translation queries.

 

------------------------------------------------------------
revno: 59
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Sat 2009-03-14 07:52:24 +0100
message:
  Added caching to translation queries.
removed:
  dhis-2/dhis-i18n/dhis-i18n-translationstore-hibernate/src/main/java/org/hisp/dhis/i18n/Translation.java
  dhis-2/dhis-i18n/dhis-i18n-translationstore-hibernate/src/main/java/org/hisp/dhis/i18n/TranslationService.java
  dhis-2/dhis-i18n/dhis-i18n-translationstore-hibernate/src/main/java/org/hisp/dhis/i18n/TranslationStore.java
added:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/i18n/Translation.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/i18n/TranslationService.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/i18n/TranslationStore.java
modified:
  dhis-2/dhis-i18n/dhis-i18n-translationstore-hibernate/src/main/java/org/hisp/dhis/i18n/hibernate/HibernateTranslationStore.java
  dhis-2/dhis-i18n/dhis-i18n-translationstore-hibernate/src/main/resources/org/hisp/dhis/i18n/hibernate/Translation.hbm.xml
  dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/ehcache.xml

=== added file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/i18n/Translation.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/i18n/Translation.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/i18n/Translation.java	2009-03-14 06:52:24 +0000
@@ -0,0 +1,165 @@
+package org.hisp.dhis.i18n;
+
+/*
+ * Copyright (c) 2004-2007, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ *   list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ *   be used to endorse or promote products derived from this software without
+ *   specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import java.io.Serializable;
+
+/**
+ * @author Oyvind Brucker
+ */
+public class Translation implements Serializable
+{
+    private String className;
+
+    private int id;
+
+    private String locale;
+
+    private String property;
+
+    private String value;
+
+    // -------------------------------------------------------------------------
+    // Constructors
+    // -------------------------------------------------------------------------
+
+    public Translation()
+    {
+    }
+
+    public Translation( String className, int id, String locale, String property, String value )
+    {
+        this.className = className;
+        this.id = id;
+        this.locale = locale;
+        this.property = property;
+        this.value = value;
+    }
+
+    // -------------------------------------------------------------------------
+    // Getters and setters
+    // -------------------------------------------------------------------------
+
+    public String getClassName()
+    {
+        return className;
+    }
+
+    public void setClassName( String className )
+    {
+        this.className = className;
+    }
+
+    public int getId()
+    {
+        return id;
+    }
+
+    public void setId( int id )
+    {
+        this.id = id;
+    }
+
+    public String getLocale()
+    {
+        return locale;
+    }
+
+    public void setLocale( String locale )
+    {
+        this.locale = locale;
+    }
+
+    public String getProperty()
+    {
+        return property;
+    }
+
+    public void setProperty( String property )
+    {
+        this.property = property;
+    }
+
+    public String getValue()
+    {
+        return value;
+    }
+
+    public void setValue( String value )
+    {
+        this.value = value;
+    }
+
+    // -------------------------------------------------------------------------
+    // hashCode, equals and toString
+    // -------------------------------------------------------------------------
+
+    @Override
+    public int hashCode()
+    {
+        final int prime = 31;
+        int result = 1;
+
+        result = result * prime + className.hashCode();
+        result = result * prime + id;
+        result = result * prime + locale.hashCode();
+        result = result * prime + property.hashCode();
+        
+        return result;
+    }
+
+    @Override
+    public boolean equals( Object o )
+    {
+        if ( this == o )
+        {
+            return true;
+        }
+
+        if ( o == null )
+        {
+            return false;
+        }
+
+        if ( !( o instanceof Translation ) )
+        {
+            return false;
+        }
+
+        Translation translation = (Translation) o;
+
+        return className.equals( translation.getClassName() ) && id == translation.getId() &&
+            locale.equals( translation.getLocale() ) && property.equals( translation.getProperty());
+    }
+
+    @Override
+    public String toString()
+    {
+        return "ClassName: " + className + " id: " + id + " locale: " + locale + " property: " + property + " value: " + value;
+    }
+}
\ No newline at end of file

=== added file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/i18n/TranslationService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/i18n/TranslationService.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/i18n/TranslationService.java	2009-03-14 06:52:24 +0000
@@ -0,0 +1,58 @@
+package org.hisp.dhis.i18n;
+
+/*
+ * Copyright (c) 2004-2007, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ *   list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ *   be used to endorse or promote products derived from this software without
+ *   specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import java.util.Collection;
+import java.util.Locale;
+
+/**
+ * @author Lars Helge Overland
+ * @version $Id$
+ */
+public interface TranslationService
+{
+    String ID = TranslationService.class.getName();
+    
+    Translation getTranslation( String className, int id, Locale locale, String property );
+
+    Collection<Translation> getTranslations( String className, int id, Locale locale );
+
+    Collection<Translation> getTranslations( String className, Locale locale );
+
+    Collection<Translation> getAllTranslations();
+
+    void addTranslation( Translation translation );
+
+    void updateTranslation( Translation translation );
+
+    void deleteTranslation( Translation translation );
+
+    Collection<Locale> getAvailableLocales();
+
+    void deleteTranslations( String className, int id );
+}

=== added file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/i18n/TranslationStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/i18n/TranslationStore.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/i18n/TranslationStore.java	2009-03-14 06:52:24 +0000
@@ -0,0 +1,57 @@
+package org.hisp.dhis.i18n;
+
+/*
+ * Copyright (c) 2004-2007, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ *   list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ *   be used to endorse or promote products derived from this software without
+ *   specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import java.util.Locale;
+import java.util.Collection;
+
+/**
+ * @author Oyvind Brucker
+ */
+public interface TranslationStore
+{
+    String ID = TranslationStore.class.getName();
+
+    Translation getTranslation( String className, int id, Locale locale, String property );
+
+    Collection<Translation> getTranslations( String className, int id, Locale locale );
+
+    Collection<Translation> getTranslations( String className, Locale locale );
+
+    Collection<Translation> getAllTranslations();
+
+    void addTranslation( Translation translation );
+
+    void updateTranslation( Translation translation );
+
+    void deleteTranslation( Translation translation );
+
+    Collection<Locale> getAvailableLocales();
+
+    void deleteTranslations( String className, int id );
+}
\ No newline at end of file

=== removed file 'dhis-2/dhis-i18n/dhis-i18n-translationstore-hibernate/src/main/java/org/hisp/dhis/i18n/Translation.java'
--- dhis-2/dhis-i18n/dhis-i18n-translationstore-hibernate/src/main/java/org/hisp/dhis/i18n/Translation.java	2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-i18n/dhis-i18n-translationstore-hibernate/src/main/java/org/hisp/dhis/i18n/Translation.java	1970-01-01 00:00:00 +0000
@@ -1,165 +0,0 @@
-package org.hisp.dhis.i18n;
-
-/*
- * Copyright (c) 2004-2007, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.io.Serializable;
-
-/**
- * @author Oyvind Brucker
- */
-public class Translation implements Serializable
-{
-    private String className;
-
-    private int id;
-
-    private String locale;
-
-    private String property;
-
-    private String value;
-
-    // -------------------------------------------------------------------------
-    // Constructors
-    // -------------------------------------------------------------------------
-
-    public Translation()
-    {
-    }
-
-    public Translation( String className, int id, String locale, String property, String value )
-    {
-        this.className = className;
-        this.id = id;
-        this.locale = locale;
-        this.property = property;
-        this.value = value;
-    }
-
-    // -------------------------------------------------------------------------
-    // Getters and setters
-    // -------------------------------------------------------------------------
-
-    public String getClassName()
-    {
-        return className;
-    }
-
-    public void setClassName( String className )
-    {
-        this.className = className;
-    }
-
-    public int getId()
-    {
-        return id;
-    }
-
-    public void setId( int id )
-    {
-        this.id = id;
-    }
-
-    public String getLocale()
-    {
-        return locale;
-    }
-
-    public void setLocale( String locale )
-    {
-        this.locale = locale;
-    }
-
-    public String getProperty()
-    {
-        return property;
-    }
-
-    public void setProperty( String property )
-    {
-        this.property = property;
-    }
-
-    public String getValue()
-    {
-        return value;
-    }
-
-    public void setValue( String value )
-    {
-        this.value = value;
-    }
-
-    // -------------------------------------------------------------------------
-    // hashCode, equals and toString
-    // -------------------------------------------------------------------------
-
-    @Override
-    public int hashCode()
-    {
-        final int prime = 31;
-        int result = 1;
-
-        result = result * prime + className.hashCode();
-        result = result * prime + id;
-        result = result * prime + locale.hashCode();
-        result = result * prime + property.hashCode();
-        
-        return result;
-    }
-
-    @Override
-    public boolean equals( Object o )
-    {
-        if ( this == o )
-        {
-            return true;
-        }
-
-        if ( o == null )
-        {
-            return false;
-        }
-
-        if ( !( o instanceof Translation ) )
-        {
-            return false;
-        }
-
-        Translation translation = (Translation) o;
-
-        return className.equals( translation.getClassName() ) && id == translation.getId() &&
-            locale.equals( translation.getLocale() ) && property.equals( translation.getProperty());
-    }
-
-    @Override
-    public String toString()
-    {
-        return "ClassName: " + className + " id: " + id + " locale: " + locale + " property: " + property + " value: " + value;
-    }
-}
\ No newline at end of file

=== removed file 'dhis-2/dhis-i18n/dhis-i18n-translationstore-hibernate/src/main/java/org/hisp/dhis/i18n/TranslationService.java'
--- dhis-2/dhis-i18n/dhis-i18n-translationstore-hibernate/src/main/java/org/hisp/dhis/i18n/TranslationService.java	2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-i18n/dhis-i18n-translationstore-hibernate/src/main/java/org/hisp/dhis/i18n/TranslationService.java	1970-01-01 00:00:00 +0000
@@ -1,58 +0,0 @@
-package org.hisp.dhis.i18n;
-
-/*
- * Copyright (c) 2004-2007, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Collection;
-import java.util.Locale;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public interface TranslationService
-{
-    String ID = TranslationService.class.getName();
-    
-    Translation getTranslation( String className, int id, Locale locale, String property );
-
-    Collection<Translation> getTranslations( String className, int id, Locale locale );
-
-    Collection<Translation> getTranslations( String className, Locale locale );
-
-    Collection<Translation> getAllTranslations();
-
-    void addTranslation( Translation translation );
-
-    void updateTranslation( Translation translation );
-
-    void deleteTranslation( Translation translation );
-
-    Collection<Locale> getAvailableLocales();
-
-    void deleteTranslations( String className, int id );
-}

=== removed file 'dhis-2/dhis-i18n/dhis-i18n-translationstore-hibernate/src/main/java/org/hisp/dhis/i18n/TranslationStore.java'
--- dhis-2/dhis-i18n/dhis-i18n-translationstore-hibernate/src/main/java/org/hisp/dhis/i18n/TranslationStore.java	2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-i18n/dhis-i18n-translationstore-hibernate/src/main/java/org/hisp/dhis/i18n/TranslationStore.java	1970-01-01 00:00:00 +0000
@@ -1,57 +0,0 @@
-package org.hisp.dhis.i18n;
-
-/*
- * Copyright (c) 2004-2007, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- *   list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- *   this list of conditions and the following disclaimer in the documentation
- *   and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- *   be used to endorse or promote products derived from this software without
- *   specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import java.util.Locale;
-import java.util.Collection;
-
-/**
- * @author Oyvind Brucker
- */
-public interface TranslationStore
-{
-    String ID = TranslationStore.class.getName();
-
-    Translation getTranslation( String className, int id, Locale locale, String property );
-
-    Collection<Translation> getTranslations( String className, int id, Locale locale );
-
-    Collection<Translation> getTranslations( String className, Locale locale );
-
-    Collection<Translation> getAllTranslations();
-
-    void addTranslation( Translation translation );
-
-    void updateTranslation( Translation translation );
-
-    void deleteTranslation( Translation translation );
-
-    Collection<Locale> getAvailableLocales();
-
-    void deleteTranslations( String className, int id );
-}
\ No newline at end of file

=== modified file 'dhis-2/dhis-i18n/dhis-i18n-translationstore-hibernate/src/main/java/org/hisp/dhis/i18n/hibernate/HibernateTranslationStore.java'
--- dhis-2/dhis-i18n/dhis-i18n-translationstore-hibernate/src/main/java/org/hisp/dhis/i18n/hibernate/HibernateTranslationStore.java	2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-i18n/dhis-i18n-translationstore-hibernate/src/main/java/org/hisp/dhis/i18n/hibernate/HibernateTranslationStore.java	2009-03-14 06:52:24 +0000
@@ -100,6 +100,8 @@
         criteria.add( Restrictions.eq( "id", id ) );
         criteria.add( Restrictions.eq( "locale", locale.toString() ) );
 
+        criteria.setCacheable( true );
+        
         return criteria.list();
     }
 

=== modified file 'dhis-2/dhis-i18n/dhis-i18n-translationstore-hibernate/src/main/resources/org/hisp/dhis/i18n/hibernate/Translation.hbm.xml'
--- dhis-2/dhis-i18n/dhis-i18n-translationstore-hibernate/src/main/resources/org/hisp/dhis/i18n/hibernate/Translation.hbm.xml	2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-i18n/dhis-i18n-translationstore-hibernate/src/main/resources/org/hisp/dhis/i18n/hibernate/Translation.hbm.xml	2009-03-14 06:52:24 +0000
@@ -5,6 +5,8 @@
 <hibernate-mapping>
   <class name="org.hisp.dhis.i18n.Translation" table="translation">
 
+    <cache usage="read-write"/>
+    
     <composite-id>
       <key-property name="className" column="objectclass" length="127"/>
       <key-property name="id" column="objectid"/>

=== 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	2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-support/dhis-support-hibernate/src/main/resources/ehcache.xml	2009-03-14 06:52:24 +0000
@@ -60,10 +60,14 @@
     maxElementsInMemory="200"
   />
   
+  <cache name="org.hisp.dhis.i18n.Translation"
+    maxElementsInMemory="4000"
+  />
+  
   <!-- Hibernate Query Cache -->
   
   <cache name="org.hibernate.cache.StandardQueryCache"
-    maxElementsInMemory="200"
+    maxElementsInMemory="4000"
   />
 
   <cache name="org.hibernate.cache.UpdateTimestampsCache"



--

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.