Author: doogie
Date: Mon May 14 21:03:45 2012 New Revision: 1338424 URL: http://svn.apache.org/viewvc?rev=1338424&view=rev Log: Deprecate all Delegator.findByAnd and Delegator.findByAndCache; introduce a new Delegator.findByAnd variant that takes a boolean cache parameter. This change continues the simplication of the delegator api. There is no longer a version of a method with a 'Cache' suffix; instead, a single version now exists that takes a boolean cache parameter. Also, there has been a trend to remove several method variants that take different numbers and types of parameters, instead preferring to fully specify all parameters; this also continues that trend. Delegator.findByAnd(String, Map) is replaced with findByAnd(String, Map, null, false). Delegator.findByAnd(String, Map, List) is replaced with findByAnd(String, Map, List, false). Delegator.findByAnd(String, Object...) is replaced with findByAnd(String, Map, null, false). The object array is converted to a map by using UtilMisc.toMap(Object...). Delegator.findByAndCache(String, Map) is replaced with findByAnd(String, Map, null, true). Delegator.findByAndCache(String, Map, List) is replaced with findByAnd(String, Map, List, true). Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/Delegator.java ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/Delegator.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/Delegator.java?rev=1338424&r1=1338423&r2=1338424&view=diff ============================================================================== --- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/Delegator.java (original) +++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/Delegator.java Mon May 14 21:03:45 2012 @@ -297,7 +297,9 @@ public interface Delegator { * The fields of the named entity to query by with their * corresponding values * @return List of GenericValue instances that match the query + * @deprecated use {@link #findByAnd(String, Map, List, boolean)} */ + @Deprecated public List<GenericValue> findByAnd(String entityName, Map<String, ? extends Object> fields) throws GenericEntityException; /** @@ -314,7 +316,9 @@ public interface Delegator { * optionally add a " ASC" for ascending or " DESC" for * descending * @return List of GenericValue instances that match the query + * @deprecated use {@link #findByAnd(String, Map, List, boolean)} */ + @Deprecated public List<GenericValue> findByAnd(String entityName, Map<String, ? extends Object> fields, List<String> orderBy) throws GenericEntityException; /** @@ -327,7 +331,9 @@ public interface Delegator { * The fields of the named entity to query by with their * corresponding values * @return List of GenericValue instances that match the query + * @deprecated use {@link #findByAnd(String, Map, List, boolean)} */ + @Deprecated public List<GenericValue> findByAnd(String entityName, Object... fields) throws GenericEntityException; /** @@ -341,7 +347,9 @@ public interface Delegator { * The fields of the named entity to query by with their * corresponding values * @return List of GenericValue instances that match the query + * @deprecated use {@link #findByAnd(String, Map, List, boolean)} */ + @Deprecated public List<GenericValue> findByAndCache(String entityName, Map<String, ? extends Object> fields) throws GenericEntityException; /** @@ -359,7 +367,9 @@ public interface Delegator { * optionally add a " ASC" for ascending or " DESC" for * descending * @return List of GenericValue instances that match the query + * @deprecated use {@link #findByAnd(String, Map, List, boolean)} */ + @Deprecated public List<GenericValue> findByAndCache(String entityName, Map<String, ? extends Object> fields, List<String> orderBy) throws GenericEntityException; /** Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java?rev=1338424&r1=1338423&r2=1338424&view=diff ============================================================================== --- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java (original) +++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java Mon May 14 21:03:45 2012 @@ -1685,7 +1685,9 @@ public class GenericDelegator implements /* (non-Javadoc) * @see org.ofbiz.entity.Delegator#findByAnd(java.lang.String, java.lang.Object) + * @deprecated use {@link #findByAnd(String, Map, List, boolean)} */ + @Deprecated public List<GenericValue> findByAnd(String entityName, Object... fields) throws GenericEntityException { EntityCondition ecl = EntityCondition.makeCondition(UtilMisc.<String, Object>toMap(fields)); return this.findList(entityName, ecl, null, null, null, false); @@ -1693,7 +1695,9 @@ public class GenericDelegator implements /* (non-Javadoc) * @see org.ofbiz.entity.Delegator#findByAnd(java.lang.String, java.util.Map) + * @deprecated use {@link #findByAnd(String, Map, List, boolean)} */ + @Deprecated public List<GenericValue> findByAnd(String entityName, Map<String, ? extends Object> fields) throws GenericEntityException { EntityCondition ecl = EntityCondition.makeCondition(fields); return this.findList(entityName, ecl, null, null, null, false); @@ -1701,7 +1705,9 @@ public class GenericDelegator implements /* (non-Javadoc) * @see org.ofbiz.entity.Delegator#findByAnd(java.lang.String, java.util.Map, java.util.List) + * @deprecated use {@link #findByAnd(String, Map, List, boolean)} */ + @Deprecated public List<GenericValue> findByAnd(String entityName, Map<String, ? extends Object> fields, List<String> orderBy) throws GenericEntityException { EntityCondition ecl = EntityCondition.makeCondition(fields); return this.findList(entityName, ecl, null, orderBy, null, false); @@ -1709,14 +1715,18 @@ public class GenericDelegator implements /* (non-Javadoc) * @see org.ofbiz.entity.Delegator#findByAndCache(java.lang.String, java.util.Map) + * @deprecated use {@link #findByAnd(String, Map, List, boolean)} */ + @Deprecated public List<GenericValue> findByAndCache(String entityName, Map<String, ? extends Object> fields) throws GenericEntityException { return this.findList(entityName, EntityCondition.makeCondition(fields), null, null, null, true); } /* (non-Javadoc) * @see org.ofbiz.entity.Delegator#findByAndCache(java.lang.String, java.util.Map, java.util.List) + * @deprecated use {@link #findByAnd(String, Map, List, boolean)} */ + @Deprecated public List<GenericValue> findByAndCache(String entityName, Map<String, ? extends Object> fields, List<String> orderBy) throws GenericEntityException { return this.findList(entityName, EntityCondition.makeCondition(fields), null, orderBy, null, true); } |
Free forum by Nabble | Edit this page |