DEPRECATION: Add new findByAnd variant, that has a boolean useCache

parameter; this is the same similiar pattern that other methods have.

After all code has been modified to use this new method, the older
methods will be deprecated(and eventually replaced).

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1338400 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Adam Heath
2012-05-14 20:59:20 +00:00
parent bac00c1ea3
commit 14db0dbfda
2 changed files with 27 additions and 0 deletions
@@ -362,6 +362,26 @@ public interface Delegator {
*/
public List<GenericValue> findByAndCache(String entityName, Map<String, ? extends Object> fields, List<String> orderBy) throws GenericEntityException;
/**
* Finds Generic Entity records by all of the specified fields (ie: combined
* using AND), looking first in the cache; uses orderBy for lookup, but only
* keys results on the entityName and fields NOTE 20080502: 56 references
*
* @param entityName
* The Name of the Entity as defined in the entity XML file
* @param fields
* The fields of the named entity to query by with their
* corresponding values
* @param orderBy
* The fields of the named entity to order the query by;
* optionally add a " ASC" for ascending or " DESC" for
* descending
* @param useCache
* Whether to cache the results
* @return List of GenericValue instances that match the query
*/
public List<GenericValue> findByAnd(String entityName, Map<String, ? extends Object> fields, List<String> orderBy, boolean useCache) throws GenericEntityException;
/**
* Find a Generic Entity by its Primary Key NOTE 20080502: 550 references
* (20080503 521 left); needs to be deprecated, should use findOne instead,
@@ -1720,6 +1720,13 @@ public class GenericDelegator implements Delegator {
return this.findList(entityName, EntityCondition.makeCondition(fields), null, orderBy, null, true);
}
/* (non-Javadoc)
* @see org.ofbiz.entity.Delegator#findByAnd(java.lang.String, java.util.Map, java.util.List, boolean)
*/
public List<GenericValue> findByAnd(String entityName, Map<String, ? extends Object> fields, List<String> orderBy, boolean useCache) throws GenericEntityException {
return this.findList(entityName, EntityCondition.makeCondition(fields), null, orderBy, null, useCache);
}
/* (non-Javadoc)
* @see org.ofbiz.entity.Delegator#find(java.lang.String, org.ofbiz.entity.condition.EntityCondition, org.ofbiz.entity.condition.EntityCondition, java.util.Set, java.util.List, org.ofbiz.entity.util.EntityFindOptions)
*/