cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r427277 - in /incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src: main/java/org/apache/cayenne/access/ main/java/org/apache/cayenne/cache/ main/java/org/apache/cayenne/query/ main/java/org/apache/cayenne/remote/ test/java/org/apache/...
Date Mon, 31 Jul 2006 21:10:19 GMT
Author: aadamchik
Date: Mon Jul 31 14:10:18 2006
New Revision: 427277

URL: http://svn.apache.org/viewvc?rev=427277&view=rev
Log:
CAY-613 - cache groups support

Modified:
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/ObjectStore.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/cache/MapQueryCache.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/cache/OSQueryCache.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/query/DefaultQueryMetadata.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/query/ProcedureQuery.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/query/QueryMetadata.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/query/QueryMetadataWrapper.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/query/SQLTemplate.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/query/SelectQuery.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/remote/IncrementalQuery.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/remote/RangeQuery.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/test/java/org/apache/cayenne/cache/OSQueryCacheTst.java
    incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/test/java/org/apache/cayenne/query/MockQueryMetadata.java

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/ObjectStore.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/ObjectStore.java?rev=427277&r1=427276&r2=427277&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/ObjectStore.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/access/ObjectStore.java
Mon Jul 31 14:10:18 2006
@@ -1192,6 +1192,10 @@
         public String getCacheKey() {
             return cacheKey;
         }
+        
+        public String[] getCacheGroups() {
+            return null;
+        }
 
         public String getCachePolicy() {
             return null;

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/cache/MapQueryCache.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/cache/MapQueryCache.java?rev=427277&r1=427276&r2=427277&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/cache/MapQueryCache.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/cache/MapQueryCache.java
Mon Jul 31 14:10:18 2006
@@ -23,7 +23,6 @@
 import java.util.List;
 import java.util.Map;
 
-import org.apache.cayenne.map.ObjEntity;
 import org.apache.cayenne.query.QueryMetadata;
 import org.apache.commons.collections.map.LRUMap;
 
@@ -68,11 +67,7 @@
 
             CacheEntry entry = new CacheEntry();
             entry.list = results;
-
-            ObjEntity entity = metadata.getObjEntity();
-            if (entity != null) {
-                entry.entityName = entity.getName();
-            }
+            entry.cacheGroups = metadata.getCacheGroups();
 
             synchronized (this) {
                 map.put(key, entry);
@@ -94,14 +89,20 @@
                 Iterator it = map.values().iterator();
                 while (it.hasNext()) {
                     CacheEntry entry = (CacheEntry) it.next();
-                    if (groupKey.equals(entry.entityName)) {
-                        it.remove();
+                    if (entry.cacheGroups != null) {
+                        for (int i = 0; i < entry.cacheGroups.length; i++) {
+
+                            if (groupKey.equals(entry.cacheGroups[i])) {
+                                it.remove();
+                                break;
+                            }
+                        }
                     }
                 }
             }
         }
     }
-    
+
     public void clear() {
         synchronized (this) {
             map.clear();
@@ -115,6 +116,6 @@
     final class CacheEntry {
 
         List list;
-        String entityName;
+        String[] cacheGroups;
     }
 }

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/cache/OSQueryCache.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/cache/OSQueryCache.java?rev=427277&r1=427276&r2=427277&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/cache/OSQueryCache.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/cache/OSQueryCache.java
Mon Jul 31 14:10:18 2006
@@ -24,7 +24,6 @@
 import java.util.Map;
 import java.util.Properties;
 
-import org.apache.cayenne.map.ObjEntity;
 import org.apache.cayenne.query.QueryMetadata;
 
 import com.opensymphony.oscache.base.CacheEntry;
@@ -36,35 +35,36 @@
  * parameters are initialized from "/oscache.properties" file per <a
  * href="http://www.opensymphony.com/oscache/wiki/Configuration.html">OSCache</a>
  * documentation. In addition to the standard OSCache parameters, Cayenne provdier allows
- * to setup global and per-query cache expiration parameters. A sample oscache.properties
- * may look like this:
+ * to setup global cache expiration parameters, and parameters matching the main query
+ * cache group (i.e. the cache groups specified first). A sample oscache.properties may
+ * look like this:
  * 
  * <pre>
- *         # OSCache configuration file
- *        
- *         # OSCache standard configuration per
- *         #     http://www.opensymphony.com/oscache/wiki/Configuration.html
- *         # ---------------------------------------------------------------
- *        
- *         #cache.memory=true
- *         cache.capacity=5000
- *         cache.algorithm=com.opensymphony.oscache.base.algorithm.LRUCache
- *        
- *        
- *         # Cayenne specific properties
- *         # ---------------------------------------------------------------
- *        
- *         # Default refresh period in seconds:
- *         cayenne.default.refresh = 60
- *        
- *         # Default expiry specified as cron expressions per
- *         #    http://www.opensymphony.com/oscache/wiki/Cron%20Expressions.html
- *         # expire entries every hour on the 10's minute
- *         cayenne.default.cron = 10 * * * *
- *        
- *         # Same parameters can be overriden per query
- *         cayenne.query.xyz.refresh = 120
- *         cayenne.query.xyz.cron = 10 1 * * *
+ *          # OSCache configuration file
+ *         
+ *          # OSCache standard configuration per
+ *          #     http://www.opensymphony.com/oscache/wiki/Configuration.html
+ *          # ---------------------------------------------------------------
+ *         
+ *          #cache.memory=true
+ *          cache.capacity=5000
+ *          cache.algorithm=com.opensymphony.oscache.base.algorithm.LRUCache
+ *         
+ *         
+ *          # Cayenne specific properties
+ *          # ---------------------------------------------------------------
+ *         
+ *          # Default refresh period in seconds:
+ *          cayenne.default.refresh = 60
+ *         
+ *          # Default expiry specified as cron expressions per
+ *          #    http://www.opensymphony.com/oscache/wiki/Cron%20Expressions.html
+ *          # expire entries every hour on the 10's minute
+ *          cayenne.default.cron = 10 * * * *
+ *         
+ *          # Same parameters can be overriden per query
+ *          cayenne.group.xyz.refresh = 120
+ *          cayenne.group.xyz.cron = 10 1 * * *
  * </pre>
  * 
  * @since 3.0
@@ -77,7 +77,7 @@
     static String DEFAULT_REFRESH_KEY = "cayenne.default.refresh";
     static String DEFAULT_CRON_KEY = "cayenne.default.cron";
 
-    static String QUERY_PREFIX = "cayenne.query.";
+    static String GROUP_PREFIX = "cayenne.group.";
     static String REFRESH_SUFFIX = ".refresh";
     static String CRON_SUFFIX = ".cron";
 
@@ -129,16 +129,16 @@
                 }
 
                 String key = entry.getKey().toString();
-                if (key.startsWith(QUERY_PREFIX)) {
+                if (key.startsWith(GROUP_PREFIX)) {
 
                     if (key.endsWith(REFRESH_SUFFIX)) {
-                        String name = key.substring(QUERY_PREFIX.length(), key.length()
+                        String name = key.substring(GROUP_PREFIX.length(), key.length()
                                 - REFRESH_SUFFIX.length());
 
                         nonNullSpec(name).setRefreshPeriod(entry.getValue());
                     }
                     else if (key.endsWith(CRON_SUFFIX)) {
-                        String name = key.substring(QUERY_PREFIX.length(), key.length()
+                        String name = key.substring(GROUP_PREFIX.length(), key.length()
                                 - CRON_SUFFIX.length());
 
                         nonNullSpec(name).cronExpression = entry.getValue().toString();
@@ -176,7 +176,10 @@
         RefreshSpecification refresh = null;
 
         if (refreshSpecifications != null) {
-            refresh = (RefreshSpecification) refreshSpecifications.get(key);
+            String[] groups = metadata.getCacheGroups();
+            if (groups != null && groups.length > 0) {
+                refresh = (RefreshSpecification) refreshSpecifications.get(groups[0]);
+            }
         }
 
         if (refresh == null) {
@@ -198,14 +201,7 @@
     public void put(QueryMetadata metadata, List results) {
         String key = metadata.getCacheKey();
         if (key != null) {
-
-            ObjEntity entity = metadata.getObjEntity();
-
-            String[] groups = entity != null ? new String[] {
-                entity.getName()
-            } : null;
-
-            cache.putInCache(key, results, groups);
+            cache.putInCache(key, results, metadata.getCacheGroups());
         }
     }
 

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java?rev=427277&r1=427276&r2=427277&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java
Mon Jul 31 14:10:18 2006
@@ -24,6 +24,7 @@
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.StringTokenizer;
 
 import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.Persistent;
@@ -53,13 +54,13 @@
 
     PrefetchTreeNode prefetchTree;
     String cacheKey;
+    String[] cacheGroups;
 
     transient ObjEntity objEntity;
     transient DbEntity dbEntity;
     transient DataMap dataMap;
     transient Object lastRoot;
     transient EntityResolver lastEntityResolver;
-    
 
     /**
      * Copies values of this object to another SelectInfo object.
@@ -154,6 +155,7 @@
                 .get(QueryMetadata.RESOLVING_INHERITED_PROPERTY);
 
         Object cachePolicy = properties.get(QueryMetadata.CACHE_POLICY_PROPERTY);
+        Object cacheGroups = properties.get(QueryMetadata.CACHE_GROUPS_PROPERTY);
 
         // init ivars from properties
         this.fetchLimit = (fetchLimit != null)
@@ -179,6 +181,18 @@
         this.cachePolicy = (cachePolicy != null)
                 ? cachePolicy.toString()
                 : QueryMetadata.CACHE_POLICY_DEFAULT;
+
+        this.cacheGroups = null;
+        if (cacheGroups instanceof String[]) {
+            this.cacheGroups = (String[]) cacheGroups;
+        }
+        else if (cacheGroups instanceof String) {
+            StringTokenizer toks = new StringTokenizer(cacheGroups.toString(), ",");
+            this.cacheGroups = new String[toks.countTokens()];
+            for (int i = 0; i < this.cacheGroups.length; i++) {
+                this.cacheGroups[i] = toks.nextToken();
+            }
+        }
     }
 
     public void encodeAsXML(XMLEncoder encoder) {
@@ -216,6 +230,14 @@
         if (prefetchTree != null) {
             prefetchTree.encodeAsXML(encoder);
         }
+        
+        if (cacheGroups != null && cacheGroups.length > 0) {
+            StringBuffer buffer = new StringBuffer(cacheGroups[0]);
+            for (int i = 1; i < cacheGroups.length; i++) {
+                buffer.append(',').append(cacheGroups[i]);
+            }
+            encoder.printProperty(QueryMetadata.CACHE_GROUPS_PROPERTY, cachePolicy);
+        }
     }
 
     /**
@@ -285,6 +307,20 @@
 
     void setCachePolicy(String policy) {
         this.cachePolicy = policy;
+    }
+
+    /**
+     * @since 3.0
+     */
+    public String[] getCacheGroups() {
+        return cacheGroups;
+    }
+
+    /**
+     * @since 3.0
+     */
+    void setCacheGroups(String[] groups) {
+        this.cacheGroups = groups;
     }
 
     public boolean isFetchingDataRows() {

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/query/DefaultQueryMetadata.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/query/DefaultQueryMetadata.java?rev=427277&r1=427276&r2=427277&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/query/DefaultQueryMetadata.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/query/DefaultQueryMetadata.java
Mon Jul 31 14:10:18 2006
@@ -69,6 +69,10 @@
     public String getCacheKey() {
         return null;
     }
+    
+    public String[] getCacheGroups() {
+        return null;
+    }
 
     public String getCachePolicy() {
         return QueryMetadata.CACHE_POLICY_DEFAULT;

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/query/ProcedureQuery.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/query/ProcedureQuery.java?rev=427277&r1=427276&r2=427277&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/query/ProcedureQuery.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/query/ProcedureQuery.java
Mon Jul 31 14:10:18 2006
@@ -293,6 +293,20 @@
     public void setCachePolicy(String policy) {
         this.metaData.setCachePolicy(policy);
     }
+    
+    /**
+     * @since 3.0
+     */
+    public String[] getCacheGroups() {
+        return metaData.getCacheGroups();
+    }
+
+    /**
+     * @since 3.0
+     */
+    public void setCacheGroups(String[] cachGroups) {
+        this.metaData.setCacheGroups(cachGroups);
+    }
 
     public int getFetchLimit() {
         return metaData.getFetchLimit();

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/query/QueryMetadata.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/query/QueryMetadata.java?rev=427277&r1=427276&r2=427277&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/query/QueryMetadata.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/query/QueryMetadata.java
Mon Jul 31 14:10:18 2006
@@ -93,6 +93,11 @@
     public static final boolean RESOLVING_INHERITED_DEFAULT = true;
 
     public static final String CACHE_POLICY_PROPERTY = "cayenne.GenericSelectQuery.cachePolicy";
+    
+    /**
+     * @since 3.0
+     */
+    public static final String CACHE_GROUPS_PROPERTY = "cayenne.GenericSelectQuery.cacheGroups";
 
     public static final String CACHE_POLICY_DEFAULT = NO_CACHE;
 
@@ -128,6 +133,16 @@
      * caching. If null is returned, no caching is performed.
      */
     String getCacheKey();
+
+    /**
+     * Returns an optional array of cache "groups". Cache groups allow to invalidate query
+     * caches in bulk on different events. Usually the first group in the array is
+     * considered to be the "main" group that is used for declarative cache invalidation
+     * with some cache providers.
+     * 
+     * @since 3.0
+     */
+    String[] getCacheGroups();
 
     /**
      * Returns <code>true</code> if this query should produce a list of data
rows as

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/query/QueryMetadataWrapper.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/query/QueryMetadataWrapper.java?rev=427277&r1=427276&r2=427277&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/query/QueryMetadataWrapper.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/query/QueryMetadataWrapper.java
Mon Jul 31 14:10:18 2006
@@ -86,6 +86,12 @@
         return (overrideExists(QueryMetadata.CACHE_POLICY_PROPERTY)) ? (String) overrides
                 .get(QueryMetadata.CACHE_POLICY_PROPERTY) : info.getCachePolicy();
     }
+    
+    public String[] getCacheGroups() {
+        return (overrideExists(QueryMetadata.CACHE_GROUPS_PROPERTY))
+                ? (String[]) overrides.get(QueryMetadata.CACHE_GROUPS_PROPERTY)
+                : info.getCacheGroups();
+    }
 
     public boolean isFetchingDataRows() {
         if (!overrideExists(QueryMetadata.FETCHING_DATA_ROWS_PROPERTY)) {

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/query/SQLTemplate.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/query/SQLTemplate.java?rev=427277&r1=427276&r2=427277&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/query/SQLTemplate.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/query/SQLTemplate.java
Mon Jul 31 14:10:18 2006
@@ -335,6 +335,20 @@
     public void setCachePolicy(String policy) {
         this.selectInfo.setCachePolicy(policy);
     }
+    
+    /**
+     * @since 3.0
+     */
+    public String[] getCacheGroups() {
+        return selectInfo.getCacheGroups();
+    }
+
+    /**
+     * @since 3.0
+     */
+    public void setCacheGroups(String[] cachGroups) {
+        this.selectInfo.setCacheGroups(cachGroups);
+    }
 
     public int getFetchLimit() {
         return selectInfo.getFetchLimit();

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/query/SelectQuery.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/query/SelectQuery.java?rev=427277&r1=427276&r2=427277&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/query/SelectQuery.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/query/SelectQuery.java
Mon Jul 31 14:10:18 2006
@@ -558,6 +558,20 @@
     }
 
     /**
+     * @since 3.0
+     */
+    public String[] getCacheGroups() {
+        return selectInfo.getCacheGroups();
+    }
+
+    /**
+     * @since 3.0
+     */
+    public void setCacheGroups(String[] cachGroups) {
+        this.selectInfo.setCacheGroups(cachGroups);
+    }
+
+    /**
      * Returns the fetchLimit.
      * 
      * @return int

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/remote/IncrementalQuery.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/remote/IncrementalQuery.java?rev=427277&r1=427276&r2=427277&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/remote/IncrementalQuery.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/remote/IncrementalQuery.java
Mon Jul 31 14:10:18 2006
@@ -62,6 +62,10 @@
             public String getCacheKey() {
                 return cacheKey;
             }
+            
+            public String[] getCacheGroups() {
+                return metadata.getCacheGroups();
+            }
 
             public String getCachePolicy() {
                 return metadata.getCachePolicy();

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/remote/RangeQuery.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/remote/RangeQuery.java?rev=427277&r1=427276&r2=427277&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/remote/RangeQuery.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/main/java/org/apache/cayenne/remote/RangeQuery.java
Mon Jul 31 14:10:18 2006
@@ -70,6 +70,10 @@
             public String getCacheKey() {
                 return cacheKey;
             }
+            
+            public String[] getCacheGroups() {
+                return null;
+            }
 
             public int getFetchStartIndex() {
                 return fetchStartIndex;

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/test/java/org/apache/cayenne/cache/OSQueryCacheTst.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/test/java/org/apache/cayenne/cache/OSQueryCacheTst.java?rev=427277&r1=427276&r2=427277&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/test/java/org/apache/cayenne/cache/OSQueryCacheTst.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/test/java/org/apache/cayenne/cache/OSQueryCacheTst.java
Mon Jul 31 14:10:18 2006
@@ -53,13 +53,13 @@
     public void testQueryOverrides() {
 
         Properties props = new Properties();
-        props.put(OSQueryCache.QUERY_PREFIX + "ABC" + OSQueryCache.REFRESH_SUFFIX, "25");
+        props.put(OSQueryCache.GROUP_PREFIX + "ABC" + OSQueryCache.REFRESH_SUFFIX, "25");
         props.put(
-                OSQueryCache.QUERY_PREFIX + "ABC" + OSQueryCache.CRON_SUFFIX,
+                OSQueryCache.GROUP_PREFIX + "ABC" + OSQueryCache.CRON_SUFFIX,
                 "12 * * * * *");
-        props.put(OSQueryCache.QUERY_PREFIX + "XYZ" + OSQueryCache.REFRESH_SUFFIX, "35");
+        props.put(OSQueryCache.GROUP_PREFIX + "XYZ" + OSQueryCache.REFRESH_SUFFIX, "35");
         props.put(
-                OSQueryCache.QUERY_PREFIX + "XYZ" + OSQueryCache.CRON_SUFFIX,
+                OSQueryCache.GROUP_PREFIX + "XYZ" + OSQueryCache.CRON_SUFFIX,
                 "24 * * * * *");
 
         OSQueryCache cache = new OSQueryCache(props);

Modified: incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/test/java/org/apache/cayenne/query/MockQueryMetadata.java
URL: http://svn.apache.org/viewvc/incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/test/java/org/apache/cayenne/query/MockQueryMetadata.java?rev=427277&r1=427276&r2=427277&view=diff
==============================================================================
--- incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/test/java/org/apache/cayenne/query/MockQueryMetadata.java
(original)
+++ incubator/cayenne/main/trunk/core/cayenne-jdk1.4-core/src/test/java/org/apache/cayenne/query/MockQueryMetadata.java
Mon Jul 31 14:10:18 2006
@@ -49,6 +49,10 @@
     public String getCacheKey() {
         return null;
     }
+    
+    public String[] getCacheGroups() {
+        return null;
+    }
 
     public boolean isFetchingDataRows() {
         return false;



Mime
View raw message