當前位置: 首頁>>代碼示例>>Java>>正文


Java EntityCondition.entityMatches方法代碼示例

本文整理匯總了Java中org.ofbiz.entity.condition.EntityCondition.entityMatches方法的典型用法代碼示例。如果您正苦於以下問題:Java EntityCondition.entityMatches方法的具體用法?Java EntityCondition.entityMatches怎麽用?Java EntityCondition.entityMatches使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.ofbiz.entity.condition.EntityCondition的用法示例。


在下文中一共展示了EntityCondition.entityMatches方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: filterByAnd

import org.ofbiz.entity.condition.EntityCondition; //導入方法依賴的package包/類
/**
 *returns the values that match all of the exprs in list
 *
 *@param values List of GenericValues
 *@param exprs the expressions that must validate to true
 *@return List of GenericValue's that match the values in fields
 */
public static <T extends GenericEntity> List<T> filterByAnd(List<T> values, List<? extends EntityCondition> exprs) {
    if (values == null) return null;
    if (UtilValidate.isEmpty(exprs)) {
        // no constraints... oh well
        return values;
    }

    List<T> result = new LinkedList<T>();
    for (T value: values) {
        boolean include = true;

        for (EntityCondition condition: exprs) {
            include = condition.entityMatches(value);
            if (!include) break;
        }
        if (include) {
            result.add(value);
        }
    }
    return result;
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:29,代碼來源:EntityUtil.java

示例2: filterByOr

import org.ofbiz.entity.condition.EntityCondition; //導入方法依賴的package包/類
/**
 *returns the values that match any of the exprs in list
 *
 *@param values List of GenericValues
 *@param exprs the expressions that must validate to true
 *@return List of GenericValue's that match the values in fields
 */
public static <T extends GenericEntity> List<T> filterByOr(List<T> values, List<? extends EntityCondition> exprs) {
    if (values == null) return null;
    if (UtilValidate.isEmpty(exprs)) {
        return values;
    }

    List<T> result = new LinkedList<T>();
    for (T value: values) {
        boolean include = false;

        for (EntityCondition condition: exprs) {
            include = condition.entityMatches(value);
            if (include) break;
        }
        if (include) {
            result.add(value);
        }
    }
    return result;
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:28,代碼來源:EntityUtil.java

示例3: remove

import org.ofbiz.entity.condition.EntityCondition; //導入方法依賴的package包/類
public void remove(String entityName, EntityCondition condition) {
    UtilCache<GenericPK, GenericValue> entityCache = getCache(entityName);
    if (entityCache == null) return;
    for (GenericPK pk: entityCache.getCacheLineKeys()) {
        GenericValue entity = entityCache.get(pk);
        if (entity == null) continue;
        if (condition.entityMatches(entity)) entityCache.remove(pk);
    }
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:10,代碼來源:EntityCache.java

示例4: filterByCondition

import org.ofbiz.entity.condition.EntityCondition; //導入方法依賴的package包/類
public static <T extends GenericEntity> List<T> filterByCondition(List<T> values, EntityCondition condition) {
    if (values == null) return null;

    List<T> result = new LinkedList<T>();
    for (T value: values) {
        if (condition.entityMatches(value)) {
            result.add(value);
        }
    }
    return result;
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:12,代碼來源:EntityUtil.java

示例5: filterOutByCondition

import org.ofbiz.entity.condition.EntityCondition; //導入方法依賴的package包/類
public static <T extends GenericEntity> List<T> filterOutByCondition(List<T> values, EntityCondition condition) {
    if (values == null) return null;

    List<T> result = new LinkedList<T>();
    for (T value: values) {
        if (!condition.entityMatches(value)) {
            result.add(value);
        }
    }
    return result;
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:12,代碼來源:EntityUtil.java

示例6: matches

import org.ofbiz.entity.condition.EntityCondition; //導入方法依賴的package包/類
public boolean matches(EntityCondition condition) {
    return condition.entityMatches(this);
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:4,代碼來源:GenericEntity.java


注:本文中的org.ofbiz.entity.condition.EntityCondition.entityMatches方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。