当前位置: 首页>>代码示例>>Java>>正文


Java OrPredicate类代码示例

本文整理汇总了Java中org.kuali.rice.core.api.criteria.OrPredicate的典型用法代码示例。如果您正苦于以下问题:Java OrPredicate类的具体用法?Java OrPredicate怎么用?Java OrPredicate使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OrPredicate类属于org.kuali.rice.core.api.criteria包,在下文中一共展示了OrPredicate类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: applyCompositePredicate

import org.kuali.rice.core.api.criteria.OrPredicate; //导入依赖的package包/类
private Predicate applyCompositePredicate(final CompositePredicate input) {
    Set<Predicate> appliedPredicates = new HashSet<Predicate>();

    for (Predicate predicate : input.getPredicates()) {
        appliedPredicates.add(applyPredicate(predicate));
    }

    Predicate[] appliedPredicatesArray = Iterables.toArray(appliedPredicates, Predicate.class);

    if (input instanceof AndPredicate) {
        return and(appliedPredicatesArray);
    } else if (input instanceof OrPredicate) {
        return or(appliedPredicatesArray);
    }

    return input;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:18,代码来源:AttributeTransform.java

示例2: addCompositePredicate

import org.kuali.rice.core.api.criteria.OrPredicate; //导入依赖的package包/类
/**
 * Adds a composite predicate to a criteria.
 *
 * @param p the composite predicate to add.
 * @param parent the parent criteria to add to.
 */
protected void addCompositePredicate(final CompositePredicate p, final C parent) {
    for (Predicate ip : p.getPredicates()) {
        final C inner = createInnerCriteria(parent);
        addPredicate(ip, inner);
        if (p instanceof AndPredicate) {
            addAnd(parent, inner);
        } else if (p instanceof OrPredicate) {
            addOr(parent, inner);
        } else {
            throw new UnsupportedPredicateException(p);
        }
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:20,代码来源:QueryTranslatorBase.java

示例3: addCompositePredicate

import org.kuali.rice.core.api.criteria.OrPredicate; //导入依赖的package包/类
/** adds a composite predicate to a Criteria. */
private void addCompositePredicate(final CompositePredicate p, final Criteria parent,  LookupCustomizer.Transform<Predicate, Predicate> transform) {
    for (Predicate ip : p.getPredicates()) {
        final Criteria inner = new Criteria();
        addPredicate(ip, inner, transform);
        if (p instanceof AndPredicate) {
            parent.addAndCriteria(inner);
        } else if (p instanceof OrPredicate) {
            parent.addOrCriteria(inner);
        } else {
            throw new UnsupportedPredicateException(p);
        }
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:15,代码来源:CriteriaLookupDaoOjb.java

示例4: matches

import org.kuali.rice.core.api.criteria.OrPredicate; //导入依赖的package包/类
/**
 * protected for testing
 */
protected boolean matches(T infoObject, Predicate predicate) {
    // no predicate matches everyting
    if (predicate == null) {
        return true;
    }
    if (predicate instanceof OrPredicate) {
        return matchesOr(infoObject, (OrPredicate) predicate);
    }
    if (predicate instanceof AndPredicate) {
        return matchesAnd(infoObject, (AndPredicate) predicate);
    }
    if (predicate instanceof EqualPredicate) {
        return matchesEqual(infoObject, (EqualPredicate) predicate);
    }
    if (predicate instanceof LessThanPredicate) {
        return matchesLessThan(infoObject, (LessThanPredicate) predicate);
    }
    if (predicate instanceof LessThanOrEqualPredicate) {
        return matchesLessThanOrEqual(infoObject, (LessThanOrEqualPredicate) predicate);
    }
    if (predicate instanceof GreaterThanPredicate) {
        return matchesGreaterThan(infoObject, (GreaterThanPredicate) predicate);
    }
    if (predicate instanceof GreaterThanOrEqualPredicate) {
        return matchesGreaterThanOrEqual(infoObject, (GreaterThanOrEqualPredicate) predicate);
    }
    if (predicate instanceof LikePredicate) {
        return matchesLike(infoObject, (LikePredicate) predicate);
    }
    throw new UnsupportedOperationException("predicate type not supported yet in in-memory mathcer" + predicate.getClass().getName());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:35,代码来源:CriteriaMatcherInMemory.java

示例5: matchesOr

import org.kuali.rice.core.api.criteria.OrPredicate; //导入依赖的package包/类
private boolean matchesOr(T infoObject, OrPredicate predicate) {
    for (Predicate subPred : predicate.getPredicates()) {
        if (matches(infoObject, subPred)) {
            return true;
        }
    }
    return false;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:9,代码来源:CriteriaMatcherInMemory.java

示例6: addCompositePredicate

import org.kuali.rice.core.api.criteria.OrPredicate; //导入依赖的package包/类
/** adds a composite predicate to a Criteria. */
private void addCompositePredicate(final CompositePredicate p, final Criteria parent,  LookupCustomizer.Transform<Predicate, Predicate> transform) {
    for (Predicate ip : p.getPredicates()) {
        final Criteria inner = new Criteria(parent.getEntityName());
        addPredicate(ip, inner, transform);
        if (p instanceof AndPredicate) {
            parent.and(inner);
        } else if (p instanceof OrPredicate) {
            parent.or(inner);
        } else {
            throw new UnsupportedPredicateException(p);
        }
    }
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:15,代码来源:CriteriaLookupDaoJpa.java


注:本文中的org.kuali.rice.core.api.criteria.OrPredicate类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。