cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r719515 - in /cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src: main/java/org/apache/cayenne/access/ main/java/org/apache/cayenne/access/trans/ main/java/org/apache/cayenne/query/ main/java/org/apache/cayenne/remote/ test/java/or...
Date Fri, 21 Nov 2008 07:04:36 GMT
Author: aadamchik
Date: Thu Nov 20 23:04:35 2008
New Revision: 719515

URL: http://svn.apache.org/viewvc?rev=719515&view=rev
Log:
CAY-1137 Deprecate and start ignoring QueryMetadata.isResolvingInherited()

removed conditional inheritance processing

Modified:
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataContext.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomainQueryAction.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/IncrementalFaultList.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/ObjectResolver.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/ObjectTreeResolver.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/SelectTranslator.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/ProcedureQuery.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/QueryMetadata.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/QueryMetadataWrapper.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SQLTemplate.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQuery.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/IncrementalQuery.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/IncrementalSelectQuery.java
    cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/InheritanceTest.java

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataContext.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataContext.java?rev=719515&r1=719514&r2=719515&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataContext.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataContext.java
Thu Nov 20 23:04:35 2008
@@ -80,7 +80,6 @@
  * container of an object graph, in a sense that any uncommitted changes to persistent
  * objects that are registered with the context, are not visible to the users of other
  * contexts.
- * 
  */
 public class DataContext extends BaseContext implements DataChannel {
 
@@ -130,8 +129,8 @@
 
     /**
      * Binds a DataContext to the current thread. DataContext can later be retrieved by
-     * users in the same thread by calling {@link DataContext#getThreadDataContext}.
-     * Using null parameter will unbind currently bound DataContext.
+     * users in the same thread by calling {@link DataContext#getThreadDataContext}. Using
+     * null parameter will unbind currently bound DataContext.
      * 
      * @since 1.1
      * @deprecated since 3.0, replaced by BaseContex#getThreadObjectContext().
@@ -240,8 +239,6 @@
         return queryCache;
     }
 
-
-
     /**
      * Returns a map of user-defined properties associated with this DataContext.
      * 
@@ -597,6 +594,9 @@
      * Converts a list of data rows to a list of DataObjects.
      * 
      * @since 1.1
+     * @deprecated since 3.0 as refreshing and resolvingInheritanceHierarchy flags are
+     *             deprecated. Use {@link #objectsFromDataRows(ClassDescriptor, List)}
+     *             instead.
      */
     public List objectsFromDataRows(
             ObjEntity entity,
@@ -604,20 +604,31 @@
             boolean refresh,
             boolean resolveInheritanceHierarchy) {
 
-        // TODO: andrus, 10/11/2006 - instead of doing ClassDescriptor lookup, deprecate
-        // this method, replacing it with the one that takes CD as argument. Or get rid of
-        // it all together
         ClassDescriptor descriptor = getEntityResolver().getClassDescriptor(
                 entity.getName());
-        return new ObjectResolver(this, descriptor, refresh, resolveInheritanceHierarchy)
+        return objectsFromDataRows(descriptor, dataRows);
+    }
+
+    /**
+     * Converts a list of DataRows to a List of DataObject registered with this
+     * DataContext.
+     * 
+     * @since 3.0
+     */
+    public List objectsFromDataRows(
+            ClassDescriptor descriptor,
+            List<? extends DataRow> dataRows) {
+        return new ObjectResolver(this, descriptor, true)
                 .synchronizedObjectsFromDataRows(dataRows);
     }
 
     /**
      * Converts a list of DataRows to a List of DataObject registered with this
-     * DataContext. Internally calls
-     * {@link #objectsFromDataRows(ObjEntity,List,boolean,boolean)}.
+     * DataContext.
      * 
+     * @deprecated since 3.0 as refresh and resolveInheritanceHierarchy flags are
+     *             deprecated. Use {@link #objectsFromDataRows(ClassDescriptor, List)}
+     *             instead.
      * @since 1.1
      * @see DataRow
      */
@@ -632,22 +643,31 @@
             throw new CayenneRuntimeException("Unmapped Java class: " + objectClass);
         }
 
-        return objectsFromDataRows(entity, dataRows, refresh, resolveInheritanceHierarchy);
+        ClassDescriptor descriptor = getEntityResolver().getClassDescriptor(
+                entity.getName());
+        return objectsFromDataRows(descriptor, dataRows);
     }
 
     /**
-     * Creates a DataObject from DataRow. This is a convenience shortcut to
-     * {@link #objectsFromDataRows(Class,java.util.List,boolean,boolean)}.
+     * Creates a DataObject from DataRow.
      * 
      * @see DataRow
      */
-    public DataObject objectFromDataRow(
-            Class<?> objectClass,
+    public <T extends DataObject> T objectFromDataRow(
+            Class<T> objectClass,
             DataRow dataRow,
             boolean refresh) {
-        List<?> list = objectsFromDataRows(objectClass, Collections
-                .singletonList(dataRow), refresh, true);
-        return (DataObject) list.get(0);
+
+        ObjEntity entity = this.getEntityResolver().lookupObjEntity(objectClass);
+
+        if (entity == null) {
+            throw new CayenneRuntimeException("Unmapped Java class: " + objectClass);
+        }
+
+        ClassDescriptor descriptor = getEntityResolver().getClassDescriptor(
+                entity.getName());
+        List<T> list = objectsFromDataRows(descriptor, Collections.singletonList(dataRow));
+        return list.get(0);
     }
 
     /**
@@ -662,13 +682,9 @@
             DataRow dataRow,
             boolean refresh) {
 
-        ObjEntity entity = getEntityResolver().getObjEntity(entityName);
+        ClassDescriptor descriptor = getEntityResolver().getClassDescriptor(entityName);
+        List<?> list = objectsFromDataRows(descriptor, Collections.singletonList(dataRow));
 
-        List<?> list = objectsFromDataRows(
-                entity,
-                Collections.singletonList(dataRow),
-                refresh,
-                true);
         return (DataObject) list.get(0);
     }
 
@@ -702,8 +718,9 @@
     /**
      * Instantiates a new object and registers it with this context. Object class is
      * determined from the mapped entity. Object class must have a default constructor.
-     * <p/> <i>Note: in most cases {@link #newObject(Class)} method should be
used,
-     * however this method is helpful when generic persistent classes are used.</i>
+     * <p/>
+     * <i>Note: in most cases {@link #newObject(Class)} method should be used, however
+     * this method is helpful when generic persistent classes are used.</i>
      * 
      * @since 3.0
      */
@@ -765,8 +782,9 @@
 
     /**
      * Registers a transient object with the context, recursively registering all
-     * transient persistent objects attached to this object via relationships. <p/><i>Note
-     * that since 3.0 this method takes Object as an argument instead of a
+     * transient persistent objects attached to this object via relationships.
+     * <p/>
+     * <i>Note that since 3.0 this method takes Object as an argument instead of a
      * {@link DataObject}.</i>
      * 
      * @param object new object that needs to be made persistent.
@@ -944,8 +962,8 @@
 
     /**
      * Refetches object data for ObjectId. This method is used internally by Cayenne to
-     * resolve objects in state <code>PersistenceState.HOLLOW</code>. It can
also be
-     * used to refresh certain objects.
+     * resolve objects in state <code>PersistenceState.HOLLOW</code>. It can
also be used
+     * to refresh certain objects.
      * 
      * @throws CayenneRuntimeException if object id doesn't match any records, or if there
      *             is more than one object is fetched.
@@ -1032,11 +1050,11 @@
     }
 
     /**
-     * "Flushes" the changes to the parent {@link DataChannel}. If the parent channel is
-     * a DataContext, it updates its objects with this context's changes, without a
-     * database update. If it is a DataDomain (the most common case), the changes are
-     * written to the database. To cause cascading commit all the way to the database, one
-     * must use {@link #commitChanges()}.
+     * "Flushes" the changes to the parent {@link DataChannel}. If the parent channel is
a
+     * DataContext, it updates its objects with this context's changes, without a database
+     * update. If it is a DataDomain (the most common case), the changes are written to
+     * the database. To cause cascading commit all the way to the database, one must use
+     * {@link #commitChanges()}.
      * 
      * @since 1.2
      * @see #commitChanges()
@@ -1364,8 +1382,8 @@
      * @param queryName a name of a GenericSelectQuery defined in one of the DataMaps. If
      *            no such query is defined, this method will throw a
      *            CayenneRuntimeException.
-     * @param expireCachedLists A flag that determines whether refresh of <b>cached
lists</b>
-     *            is required in case a query uses caching.
+     * @param expireCachedLists A flag that determines whether refresh of <b>cached
+     *            lists</b> is required in case a query uses caching.
      * @since 1.1
      */
     public List<?> performQuery(String queryName, boolean expireCachedLists) {
@@ -1381,8 +1399,8 @@
      *            no such query is defined, this method will throw a
      *            CayenneRuntimeException.
      * @param parameters A map of parameters to use with stored query.
-     * @param expireCachedLists A flag that determines whether refresh of <b>cached
lists</b>
-     *            is required in case a query uses caching.
+     * @param expireCachedLists A flag that determines whether refresh of <b>cached
+     *            lists</b> is required in case a query uses caching.
      * @since 1.1
      */
     public List<?> performQuery(

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomainQueryAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomainQueryAction.java?rev=719515&r1=719514&r2=719515&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomainQueryAction.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/DataDomainQueryAction.java
Thu Nov 20 23:04:35 2008
@@ -588,7 +588,7 @@
             // take a shortcut when no prefetches exist...
             if (prefetchTree == null) {
                 objects = new ObjectResolver(context, descriptor, metadata
-                        .isRefreshingObjects(), metadata.isResolvingInherited())
+                        .isRefreshingObjects())
                         .synchronizedObjectsFromDataRows(normalizedRows);
             }
             else {

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/IncrementalFaultList.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/IncrementalFaultList.java?rev=719515&r1=719514&r2=719515&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/IncrementalFaultList.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/IncrementalFaultList.java
Thu Nov 20 23:04:35 2008
@@ -53,10 +53,9 @@
  * result in an exception.
  * </p>
  * <p>
- * Performance note: certain operations like <code>toArray</code> would trigger
full
- * list fetch.
+ * Performance note: certain operations like <code>toArray</code> would trigger
full list
+ * fetch.
  * </p>
- * 
  */
 public class IncrementalFaultList<E> implements List<E> {
 
@@ -133,7 +132,6 @@
         // various parameters
         this.internalQuery = new SelectQuery(rootEntity);
         this.internalQuery.setFetchingDataRows(metadata.isFetchingDataRows());
-        this.internalQuery.setResolvingInherited(metadata.isResolvingInherited());
         this.internalQuery.setPrefetchTree(metadata.getPrefetchTree());
 
         this.helper = createHelper(metadata);
@@ -251,9 +249,9 @@
             // fill in the first page AFTER the iterator was closed, otherwise we may
             // cause an (unobvious) deadlock due to connection pool exhaustion
             if (!fetchesDataRows && lastResolved > 0) {
-                List objects = dataContext.objectsFromDataRows(rootEntity, elementsList
-                        .subList(0, lastResolved), info.isRefreshingObjects(), info
-                        .isResolvingInherited());
+                List objects = dataContext.objectsFromDataRows(
+                        info.getClassDescriptor(),
+                        elementsList.subList(0, lastResolved));
 
                 for (int i = 0; i < lastResolved; i++) {
                     elementsList.set(i, objects.get(i));

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/ObjectResolver.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/ObjectResolver.java?rev=719515&r1=719514&r2=719515&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/ObjectResolver.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/ObjectResolver.java
Thu Nov 20 23:04:35 2008
@@ -51,19 +51,13 @@
 
     EntityInheritanceTree inheritanceTree;
     boolean refreshObjects;
-    boolean resolveInheritance;
     DataRowStore cache;
 
-    ObjectResolver(DataContext context, ClassDescriptor descriptor, boolean refresh,
-            boolean resolveInheritanceHierarchy) {
-        init(context, descriptor, refresh, resolveInheritanceHierarchy);
+    ObjectResolver(DataContext context, ClassDescriptor descriptor, boolean refresh) {
+        init(context, descriptor, refresh);
     }
 
-    void init(
-            DataContext context,
-            ClassDescriptor descriptor,
-            boolean refresh,
-            boolean resolveInheritanceHierarchy) {
+    void init(DataContext context, ClassDescriptor descriptor, boolean refresh) {
         // sanity check
         DbEntity dbEntity = descriptor.getEntity().getDbEntity();
         if (dbEntity == null) {
@@ -87,9 +81,6 @@
         this.descriptor = descriptor;
         this.inheritanceTree = context.getEntityResolver().lookupInheritanceTree(
                 descriptor.getEntity());
-        this.resolveInheritance = (inheritanceTree != null)
-                ? resolveInheritanceHierarchy
-                : false;
     }
 
     /**
@@ -119,11 +110,11 @@
         while (it.hasNext()) {
             DataRow row = (DataRow) it.next();
             Persistent object = objectFromDataRow(row);
-            
+
             if (object == null) {
                 throw new CayenneRuntimeException("Can't build Object from row: " + row);
             }
-            
+
             results.add(object);
         }
 
@@ -207,7 +198,7 @@
         // determine entity to use
         ClassDescriptor classDescriptor;
 
-        if (resolveInheritance) {
+        if (inheritanceTree != null) {
             ObjEntity objectEntity = inheritanceTree.entityMatchingRow(row);
 
             // null probably means that inheritance qualifiers are messed up
@@ -318,7 +309,7 @@
                     .getName();
 
             Object val = dataRow.get(key);
-            
+
             // this is possible when processing left outer joint prefetches
             if (val == null) {
                 return null;

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/ObjectTreeResolver.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/ObjectTreeResolver.java?rev=719515&r1=719514&r2=719515&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/ObjectTreeResolver.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/ObjectTreeResolver.java
Thu Nov 20 23:04:35 2008
@@ -218,7 +218,7 @@
 
             node.setDataRows(rows);
             node.setResolver(new ObjectResolver(context, descriptor, queryMetadata
-                    .isRefreshingObjects(), queryMetadata.isResolvingInherited()));
+                    .isRefreshingObjects()));
             node.setIncoming(arc);
 
             if (currentNode != null) {

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/SelectTranslator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/SelectTranslator.java?rev=719515&r1=719514&r2=719515&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/SelectTranslator.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/access/trans/SelectTranslator.java
Thu Nov 20 23:04:35 2008
@@ -347,12 +347,7 @@
             }
         };
 
-        if (query.isResolvingInherited()) {
-            descriptor.visitAllProperties(visitor);
-        }
-        else {
-            descriptor.visitProperties(visitor);
-        }
+        descriptor.visitAllProperties(visitor);
 
         // add remaining needed attrs from DbEntity
         DbEntity table = getRootDbEntity();

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java?rev=719515&r1=719514&r2=719515&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/BaseQueryMetadata.java
Thu Nov 20 23:04:35 2008
@@ -50,7 +50,6 @@
     int pageSize = QueryMetadata.PAGE_SIZE_DEFAULT;
     boolean fetchingDataRows = QueryMetadata.FETCHING_DATA_ROWS_DEFAULT;
     boolean refreshingObjects = QueryMetadata.REFRESHING_OBJECTS_DEFAULT;
-    boolean resolvingInherited = QueryMetadata.RESOLVING_INHERITED_DEFAULT;
     QueryCacheStrategy cacheStrategy = QueryCacheStrategy.getDefaultStrategy();
 
     PrefetchTreeNode prefetchTree;
@@ -77,7 +76,6 @@
         this.fetchLimit = info.getFetchLimit();
         this.pageSize = info.getPageSize();
         this.refreshingObjects = info.isRefreshingObjects();
-        this.resolvingInherited = info.isResolvingInherited();
         this.cacheStrategy = info.getCacheStrategy();
         this.cacheKey = info.getCacheKey();
 
@@ -159,9 +157,6 @@
         Object fetchingDataRows = properties
                 .get(QueryMetadata.FETCHING_DATA_ROWS_PROPERTY);
 
-        Object resolvingInherited = properties
-                .get(QueryMetadata.RESOLVING_INHERITED_PROPERTY);
-
         // deprecated cache policy... handle it for backwards compatibility.
         Object cachePolicy = properties.get(QueryMetadata.CACHE_POLICY_PROPERTY);
         Object cacheStrategy = properties.get(QueryMetadata.CACHE_STRATEGY_PROPERTY);
@@ -189,10 +184,6 @@
                 ? "true".equalsIgnoreCase(fetchingDataRows.toString())
                 : QueryMetadata.FETCHING_DATA_ROWS_DEFAULT;
 
-        this.resolvingInherited = (resolvingInherited != null)
-                ? "true".equalsIgnoreCase(resolvingInherited.toString())
-                : QueryMetadata.RESOLVING_INHERITED_DEFAULT;
-
         this.cacheStrategy = (cacheStrategy != null) ? QueryCacheStrategy
                 .safeValueOf(cacheStrategy.toString()) : QueryCacheStrategy
                 .getDefaultStrategy();
@@ -228,12 +219,6 @@
                     fetchingDataRows);
         }
 
-        if (resolvingInherited != QueryMetadata.RESOLVING_INHERITED_DEFAULT) {
-            encoder.printProperty(
-                    QueryMetadata.RESOLVING_INHERITED_PROPERTY,
-                    resolvingInherited);
-        }
-
         if (fetchOffset != QueryMetadata.FETCH_OFFSET_DEFAULT) {
             encoder.printProperty(QueryMetadata.FETCH_OFFSET_PROPERTY, fetchOffset);
         }
@@ -464,8 +449,11 @@
         return refreshingObjects;
     }
 
+    /**
+     * @deprecated since 3.0. Inheritance resolving is not optional anymore.
+     */
     public boolean isResolvingInherited() {
-        return resolvingInherited;
+        return true;
     }
 
     void setFetchingDataRows(boolean b) {
@@ -488,10 +476,6 @@
         refreshingObjects = b;
     }
 
-    void setResolvingInherited(boolean b) {
-        resolvingInherited = b;
-    }
-
     /**
      * Adds a joint prefetch.
      * 

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/ProcedureQuery.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/ProcedureQuery.java?rev=719515&r1=719514&r2=719515&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/ProcedureQuery.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/ProcedureQuery.java
Thu Nov 20 23:04:35 2008
@@ -367,7 +367,7 @@
     }
 
     /**
-     * @deprecate since 3.0. With introduction of the cache strategies this setting is
+     * @deprecated since 3.0. With introduction of the cache strategies this setting is
      *            redundant, although it is still being taken into account. It will be
      *            removed in the later versions of Cayenne.
      */
@@ -376,7 +376,7 @@
     }
 
     /**
-     * @deprecate since 3.0. With introduction of the cache strategies this setting is
+     * @deprecated since 3.0. With introduction of the cache strategies this setting is
      *            redundant, although it is still being taken into account. It will be
      *            removed in the later versions of Cayenne.
      */
@@ -384,12 +384,18 @@
         metaData.setRefreshingObjects(flag);
     }
 
+    /**
+     * @deprecated since 3.0. Inheritance resolving is not optional anymore.
+     */
     public boolean isResolvingInherited() {
-        return metaData.isResolvingInherited();
+        return true;
     }
 
+    /**
+     * @deprecated since 3.0. Inheritance resolving is not optional anymore.
+     */
     public void setResolvingInherited(boolean b) {
-        metaData.setResolvingInherited(b);
+        // noop
     }
 
     /**

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/QueryMetadata.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/QueryMetadata.java?rev=719515&r1=719514&r2=719515&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/QueryMetadata.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/QueryMetadata.java
Thu Nov 20 23:04:35 2008
@@ -72,7 +72,8 @@
     public static final String SHARED_CACHE_REFRESH = "sharedcache_refresh";
 
     /**
-     * Defines the name of the property for the query {@link #getFetchLimit() fetch limit}.
+     * Defines the name of the property for the query {@link #getFetchLimit() fetch limit}
+     * .
      */
     public static final String FETCH_LIMIT_PROPERTY = "cayenne.GenericSelectQuery.fetchLimit";
 
@@ -81,14 +82,15 @@
      * should be fetched.
      */
     public static final int FETCH_LIMIT_DEFAULT = 0;
-    
+
     /**
-     * Defines the name of the property for the query {@link #getFetchOffset() fetch offset}.
+     * Defines the name of the property for the query {@link #getFetchOffset() fetch
+     * offset}.
      * 
      * @since 3.0
      */
     public static final String FETCH_OFFSET_PROPERTY = "cayenne.GenericSelectQuery.fetchOffset";
-    
+
     /**
      * Defines default query fetch start index, which is 0, meaning that matching rows
      * selected starting from the first.
@@ -115,8 +117,14 @@
 
     public static final boolean REFRESHING_OBJECTS_DEFAULT = true;
 
+    /**
+     * @deprecated since 3.0. Inheritance resolving is not optional anymore.
+     */
     public static final String RESOLVING_INHERITED_PROPERTY = "cayenne.GenericSelectQuery.resolvingInherited";
 
+    /**
+     * @deprecated since 3.0. Inheritance resolving is not optional anymore.
+     */
     public static final boolean RESOLVING_INHERITED_DEFAULT = true;
 
     /**
@@ -204,10 +212,9 @@
     boolean isFetchingDataRows();
 
     /**
-     * Returns <code>true</code> if the query results should replace any currently
-     * cached values, returns <code>false</code> otherwise. If
-     * {@link #isFetchingDataRows()}returns <code>true</code>, this setting is
not
-     * applicable and has no effect.
+     * Returns <code>true</code> if the query results should replace any currently
cached
+     * values, returns <code>false</code> otherwise. If {@link #isFetchingDataRows()}
+     * returns <code>true</code>, this setting is not applicable and has no effect.
      * 
      * @deprecated since 3.0. With introduction of the cache strategies this setting is
      *             redundant, although it is still being taken into account. It will be
@@ -218,6 +225,8 @@
     /**
      * Returns true if objects fetched via this query should be fully resolved according
      * to the inheritance hierarchy.
+     * 
+     * @deprecated since 3.0. Inheritance resolving is not optional anymore.
      */
     boolean isResolvingInherited();
 
@@ -234,7 +243,7 @@
      * @since 3.0
      */
     int getFetchOffset();
-    
+
     /**
      * @deprecated since 3.0, renamed to {@link #getFetchOffset()}.
      */

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/QueryMetadataWrapper.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/QueryMetadataWrapper.java?rev=719515&r1=719514&r2=719515&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/QueryMetadataWrapper.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/QueryMetadataWrapper.java
Thu Nov 20 23:04:35 2008
@@ -140,6 +140,9 @@
         return b != null && b.booleanValue();
     }
 
+    /**
+     * @deprecated since 3.0 as super is deprecated.
+     */
     public boolean isRefreshingObjects() {
         if (!overrideExists(QueryMetadata.REFRESHING_OBJECTS_PROPERTY)) {
             return info.isRefreshingObjects();
@@ -149,13 +152,11 @@
         return b != null && b.booleanValue();
     }
 
+    /**
+     * @deprecated since 3.0 inheritance resolving is not optional.
+     */
     public boolean isResolvingInherited() {
-        if (!overrideExists(QueryMetadata.RESOLVING_INHERITED_PROPERTY)) {
-            return info.isResolvingInherited();
-        }
-
-        Boolean b = (Boolean) overrides.get(QueryMetadata.RESOLVING_INHERITED_PROPERTY);
-        return b != null && b.booleanValue();
+        return true;
     }
 
     public int getPageSize() {

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SQLTemplate.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SQLTemplate.java?rev=719515&r1=719514&r2=719515&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SQLTemplate.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SQLTemplate.java
Thu Nov 20 23:04:35 2008
@@ -31,7 +31,6 @@
 import org.apache.cayenne.map.MapLoader;
 import org.apache.cayenne.map.ObjEntity;
 import org.apache.cayenne.map.Procedure;
-import org.apache.cayenne.util.Util;
 import org.apache.cayenne.util.XMLEncoder;
 import org.apache.cayenne.util.XMLSerializable;
 import org.apache.commons.collections.IteratorUtils;
@@ -410,7 +409,7 @@
     }
 
     /**
-     * @deprecate since 3.0. With introduction of the cache strategies this setting is
+     * @deprecated since 3.0. With introduction of the cache strategies this setting is
      *            redundant, although it is still being taken into account. It will be
      *            removed in the later versions of Cayenne.
      */
@@ -419,7 +418,7 @@
     }
 
     /**
-     * @deprecate since 3.0. With introduction of the cache strategies this setting is
+     * @deprecated since 3.0. With introduction of the cache strategies this setting is
      *            redundant, although it is still being taken into account. It will be
      *            removed in the later versions of Cayenne.
      */
@@ -427,12 +426,18 @@
         metaData.setRefreshingObjects(flag);
     }
 
+    /**
+     * @deprecated since 3.0. Inheritance resolving is not optional anymore.
+     */
     public boolean isResolvingInherited() {
-        return metaData.isResolvingInherited();
+        return true;
     }
 
+    /**
+     * @deprecated since 3.0. Inheritance resolving is not optional anymore.
+     */
     public void setResolvingInherited(boolean b) {
-        metaData.setResolvingInherited(b);
+        // noop
     }
 
     /**

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQuery.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQuery.java?rev=719515&r1=719514&r2=719515&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQuery.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/query/SelectQuery.java
Thu Nov 20 23:04:35 2008
@@ -32,7 +32,6 @@
 import org.apache.cayenne.map.MapLoader;
 import org.apache.cayenne.map.ObjEntity;
 import org.apache.cayenne.map.Procedure;
-import org.apache.cayenne.util.Util;
 import org.apache.cayenne.util.XMLEncoder;
 import org.apache.cayenne.util.XMLSerializable;
 
@@ -515,7 +514,7 @@
      * Returns refresh policy of this query. Default is <code>true</code>.
      * 
      * @since 1.1
-     * @deprecate since 3.0. With introduction of the cache strategies this setting is
+     * @deprecated since 3.0. With introduction of the cache strategies this setting is
      *            redundant, although it is still being taken into account. It will be
      *            removed in the later versions of Cayenne.
      */
@@ -525,7 +524,7 @@
 
     /**
      * @since 1.1
-     * @deprecate since 3.0. With introduction of the cache strategies this setting is
+     * @deprecated since 3.0. With introduction of the cache strategies this setting is
      *            redundant, although it is still being taken into account. It will be
      *            removed in the later versions of Cayenne.
      */
@@ -631,9 +630,10 @@
      * to the inheritance hierarchy.
      * 
      * @since 1.1
+     * @deprecated since 3.0. Inheritance resolving is not optional anymore.
      */
     public boolean isResolvingInherited() {
-        return metaData.isResolvingInherited();
+        return true;
     }
 
     /**
@@ -641,9 +641,10 @@
      * to the inheritance hierarchy.
      * 
      * @since 1.1
+     * @deprecated since 3.0. Inheritance resolving is not optional anymore.
      */
     public void setResolvingInherited(boolean b) {
-        metaData.setResolvingInherited(b);
+        // noop
     }
 
     /**

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/IncrementalQuery.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/IncrementalQuery.java?rev=719515&r1=719514&r2=719515&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/IncrementalQuery.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/IncrementalQuery.java
Thu Nov 20 23:04:35 2008
@@ -144,10 +144,16 @@
                 return metadata.isFetchingDataRows();
             }
 
+            /**
+             * @deprecated since 3.0
+             */
             public boolean isRefreshingObjects() {
                 return metadata.isRefreshingObjects();
             }
 
+            /**
+             * @deprecated since 3.0. Inheritance resolving is not optional anymore.
+             */
             public boolean isResolvingInherited() {
                 return metadata.isResolvingInherited();
             }

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/IncrementalSelectQuery.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/IncrementalSelectQuery.java?rev=719515&r1=719514&r2=719515&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/IncrementalSelectQuery.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/main/java/org/apache/cayenne/remote/IncrementalSelectQuery.java
Thu Nov 20 23:04:35 2008
@@ -304,11 +304,17 @@
         return query.isFetchingDataRows();
     }
 
+    /**
+     * @deprecated since 3.0
+     */
     @Override
     public boolean isRefreshingObjects() {
         return query.isRefreshingObjects();
     }
 
+    /**
+     * @deprecated since 3.0. Inheritance resolving is not optional anymore.
+     */
     @Override
     public boolean isResolvingInherited() {
         return query.isResolvingInherited();

Modified: cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/InheritanceTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/InheritanceTest.java?rev=719515&r1=719514&r2=719515&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/InheritanceTest.java
(original)
+++ cayenne/main/trunk/framework/cayenne-jdk1.5-unpublished/src/test/java/org/apache/cayenne/access/InheritanceTest.java
Thu Nov 20 23:04:35 2008
@@ -148,27 +148,11 @@
         assertEquals(1, countObjectOfClass(employees, Manager.class));
     }
 
-    public void testSelectNoInheritanceResolving() throws Exception {
-        createTestData("testSelect");
-
-        // select Abstract Ppl
-        SelectQuery query = new SelectQuery(AbstractPerson.class);
-        query.setResolvingInherited(false);
-        assertFalse(query.isResolvingInherited());
-        List abstractPpl = context.performQuery(query);
-        assertEquals(6, abstractPpl.size());
-        assertEquals(0, countObjectOfClass(abstractPpl, CustomerRepresentative.class));
-        assertEquals(0, countObjectOfClass(abstractPpl, Employee.class));
-        assertEquals(0, countObjectOfClass(abstractPpl, Manager.class));
-    }
-
     public void testSelectInheritanceResolving() throws Exception {
         createTestData("testSelect");
 
         // select Abstract Ppl
         SelectQuery query = new SelectQuery(AbstractPerson.class);
-        query.setResolvingInherited(true);
-        assertTrue(query.isResolvingInherited());
         List abstractPpl = context.performQuery(query);
         assertEquals(6, abstractPpl.size());
 



Mime
View raw message