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


Java ConditionExpr類代碼示例

本文整理匯總了Java中org.ofbiz.entity.finder.EntityFinderUtil.ConditionExpr的典型用法代碼示例。如果您正苦於以下問題:Java ConditionExpr類的具體用法?Java ConditionExpr怎麽用?Java ConditionExpr使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ConditionExpr類屬於org.ofbiz.entity.finder.EntityFinderUtil包,在下文中一共展示了ConditionExpr類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: ByConditionFinder

import org.ofbiz.entity.finder.EntityFinderUtil.ConditionExpr; //導入依賴的package包/類
public ByConditionFinder(Element element) {
    super(element, "condition");

    // NOTE: the whereCondition can be null, ie (condition-expr | condition-list) is optional; if left out, means find all, or with no condition in essense
    // process condition-expr | condition-list
    Element conditionExprElement = UtilXml.firstChildElement(element, "condition-expr");
    Element conditionListElement = UtilXml.firstChildElement(element, "condition-list");
    Element conditionObjectElement = UtilXml.firstChildElement(element, "condition-object");
    if (conditionExprElement != null) {
        this.whereCondition = new ConditionExpr(conditionExprElement);
    } else if (conditionListElement != null) {
        this.whereCondition = new ConditionList(conditionListElement);
    } else if (conditionObjectElement != null) {
        this.whereCondition = new ConditionObject(conditionObjectElement);
    }

    Element havingConditionListElement = UtilXml.firstChildElement(element, "having-condition-list");
    if (havingConditionListElement != null) {
        this.havingCondition = new ConditionList(havingConditionListElement);
    }
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:22,代碼來源:ByConditionFinder.java

示例2: EntityCount

import org.ofbiz.entity.finder.EntityFinderUtil.ConditionExpr; //導入依賴的package包/類
public EntityCount(Element element, SimpleMethod simpleMethod) throws MiniLangException {
    super(element, simpleMethod);
    if (MiniLangValidate.validationOn()) {
        MiniLangValidate.attributeNames(simpleMethod, element, "entity-name", "count-field", "delegator-name");
        MiniLangValidate.requiredAttributes(simpleMethod, element, "entity-name", "count-field");
        MiniLangValidate.expressionAttributes(simpleMethod, element, "count-field", "delegator-name");
        MiniLangValidate.childElements(simpleMethod, element, "condition-expr", "condition-list", "condition-object", "having-condition-list");
        MiniLangValidate.requireAnyChildElement(simpleMethod, element, "condition-expr", "condition-list", "condition-object");
    }
    this.entityNameFse = FlexibleStringExpander.getInstance(element.getAttribute("entity-name"));
    this.countFma = FlexibleMapAccessor.getInstance(element.getAttribute("count-field"));
    int conditionElementCount = 0;
    Element conditionExprElement = UtilXml.firstChildElement(element, "condition-expr");
    conditionElementCount = conditionExprElement == null ? conditionElementCount : conditionElementCount++;
    Element conditionListElement = UtilXml.firstChildElement(element, "condition-list");
    conditionElementCount = conditionListElement == null ? conditionElementCount : conditionElementCount++;
    Element conditionObjectElement = UtilXml.firstChildElement(element, "condition-object");
    conditionElementCount = conditionObjectElement == null ? conditionElementCount : conditionElementCount++;
    if (conditionElementCount > 1) {
        MiniLangValidate.handleError("Element must include only one condition child element", simpleMethod, conditionObjectElement);
    }
    if (conditionExprElement != null) {
        this.whereCondition = new ConditionExpr(conditionExprElement);
    } else if (conditionListElement != null) {
        this.whereCondition = new ConditionList(conditionListElement);
    } else if (conditionObjectElement != null) {
        this.whereCondition = new ConditionObject(conditionObjectElement);
    } else {
        this.whereCondition = null;
    }
    Element havingConditionListElement = UtilXml.firstChildElement(element, "having-condition-list");
    if (havingConditionListElement != null) {
        this.havingCondition = new ConditionList(havingConditionListElement);
    } else {
        this.havingCondition = null;
    }
}
 
開發者ID:ilscipio,項目名稱:scipio-erp,代碼行數:38,代碼來源:EntityCount.java


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