本文整理汇总了Java中org.ofbiz.entity.finder.EntityFinderUtil.ConditionObject类的典型用法代码示例。如果您正苦于以下问题:Java ConditionObject类的具体用法?Java ConditionObject怎么用?Java ConditionObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ConditionObject类属于org.ofbiz.entity.finder.EntityFinderUtil包,在下文中一共展示了ConditionObject类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ByConditionFinder
import org.ofbiz.entity.finder.EntityFinderUtil.ConditionObject; //导入依赖的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);
}
}
示例2: EntityCount
import org.ofbiz.entity.finder.EntityFinderUtil.ConditionObject; //导入依赖的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;
}
}