diff --git a/framework/entity/src/org/ofbiz/entity/Delegator.java b/framework/entity/src/org/ofbiz/entity/Delegator.java index fbaa9b7da9..9d02e73257 100644 --- a/framework/entity/src/org/ofbiz/entity/Delegator.java +++ b/framework/entity/src/org/ofbiz/entity/Delegator.java @@ -362,6 +362,26 @@ public interface Delegator { */ public List findByAndCache(String entityName, Map fields, List 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 findByAnd(String entityName, Map fields, List 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, diff --git a/framework/entity/src/org/ofbiz/entity/GenericDelegator.java b/framework/entity/src/org/ofbiz/entity/GenericDelegator.java index 02f39e1bbc..4026402027 100644 --- a/framework/entity/src/org/ofbiz/entity/GenericDelegator.java +++ b/framework/entity/src/org/ofbiz/entity/GenericDelegator.java @@ -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 findByAnd(String entityName, Map fields, List 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) */