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


Java SingleValuedPredicate类代码示例

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


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

示例1: addPredicate

import org.kuali.rice.core.api.criteria.SingleValuedPredicate; //导入依赖的package包/类
/**
   * Adds a predicate to a criteria.
   *
   * @param p the {@link Predicate} to add.
   * @param parent the parent criteria to add to.
   */
  protected void addPredicate(Predicate p, C parent) {
      if (p instanceof PropertyPathPredicate) {
          final String pp = ((PropertyPathPredicate) p).getPropertyPath();
          if (p instanceof NotNullPredicate) {
              addNotNull(parent, pp);
          } else if (p instanceof NullPredicate) {
              addIsNull(parent, pp);
          } else if (p instanceof SingleValuedPredicate) {
              addSingleValuePredicate((SingleValuedPredicate) p, parent);
          } else if (p instanceof MultiValuedPredicate) {
              addMultiValuePredicate((MultiValuedPredicate) p, parent);
          } else {
              throw new UnsupportedPredicateException(p);
          }
      } else if (p instanceof CompositePredicate) {
          addCompositePredicate((CompositePredicate) p, parent);
} else if (p instanceof SubQueryPredicate) {
	addSubQueryPredicate((SubQueryPredicate) p, parent);
      } else {
          throw new UnsupportedPredicateException(p);
      }
  }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:29,代码来源:QueryTranslatorBase.java

示例2: addPredicate

import org.kuali.rice.core.api.criteria.SingleValuedPredicate; //导入依赖的package包/类
/** adds a predicate to a Criteria.*/
private void addPredicate(Predicate p, Criteria parent, LookupCustomizer.Transform<Predicate, Predicate> transform) {
    p = transform.apply(p);

    if (p instanceof PropertyPathPredicate) {
        final String pp = ((PropertyPathPredicate) p).getPropertyPath();
        if (p instanceof NotNullPredicate) {
            parent.addNotNull(pp);
        } else if (p instanceof NullPredicate) {
            parent.addIsNull(pp);
        } else if (p instanceof SingleValuedPredicate) {
            addSingleValuePredicate((SingleValuedPredicate) p, parent);
        } else if (p instanceof MultiValuedPredicate) {
            addMultiValuePredicate((MultiValuedPredicate) p, parent);
        } else {
            throw new UnsupportedPredicateException(p);
        }
    } else if (p instanceof CompositePredicate) {
        addCompositePredicate((CompositePredicate) p, parent, transform);
    } else {
        throw new UnsupportedPredicateException(p);
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:24,代码来源:CriteriaLookupDaoOjb.java

示例3: addPredicate

import org.kuali.rice.core.api.criteria.SingleValuedPredicate; //导入依赖的package包/类
/** adds a predicate to a Criteria.*/
private void addPredicate(Predicate p, Criteria parent, LookupCustomizer.Transform<Predicate, Predicate> transform) {
    p = transform.apply(p);

    if (p instanceof PropertyPathPredicate) {
        final String pp = ((PropertyPathPredicate) p).getPropertyPath();
        if (p instanceof NotNullPredicate) {
            parent.notNull(pp);
        } else if (p instanceof NullPredicate) {
            parent.isNull(pp);
        } else if (p instanceof SingleValuedPredicate) {
            addSingleValuePredicate((SingleValuedPredicate) p, parent);
        } else if (p instanceof MultiValuedPredicate) {
            addMultiValuePredicate((MultiValuedPredicate) p, parent);
        } else {
            throw new UnsupportedPredicateException(p);
        }
    } else if (p instanceof CompositePredicate) {
        addCompositePredicate((CompositePredicate) p, parent, transform);
    } else {
        throw new UnsupportedPredicateException(p);
    }
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:24,代码来源:CriteriaLookupDaoJpa.java

示例4: addSingleValuePredicate

import org.kuali.rice.core.api.criteria.SingleValuedPredicate; //导入依赖的package包/类
/**
   * Adds a single valued predicate to a criteria.
   *
   * @param p the single valued predicate to add.
   * @param parent the parent criteria to add to.
   */
  protected void addSingleValuePredicate(SingleValuedPredicate p, C parent) {
final Object value = getVal(p.getValue());
      final String pp = p.getPropertyPath();
      if (p instanceof EqualPredicate) {
          addEqualTo(parent, pp, value);
      } else if (p instanceof EqualIgnoreCasePredicate) {
          addEqualToIgnoreCase(parent, pp, (String) value);
      } else if (p instanceof GreaterThanOrEqualPredicate) {
          addGreaterOrEqualTo(parent, pp, value);
      } else if (p instanceof GreaterThanPredicate) {
          addGreaterThan(parent, pp, value);
      } else if (p instanceof LessThanOrEqualPredicate) {
          addLessOrEqualTo(parent, pp, value);
      } else if (p instanceof LessThanPredicate) {
          addLessThan(parent, pp, value);
      } else if (p instanceof LikePredicate) {
          //no need to convert * or ? since ojb handles the conversion/escaping
          addLike(parent, pp, value);
      } else if(p instanceof LikeIgnoreCasePredicate){
          addLikeIgnoreCase(parent,pp,(String)value);
      } else if (p instanceof NotEqualPredicate) {
          addNotEqualTo(parent, pp, value);
      } else if (p instanceof NotEqualIgnoreCasePredicate) {
          addNotEqualToIgnoreCase(parent, pp, (String) value);
} else if (p instanceof NotLikeIgnoreCasePredicate) {
	addNotLikeIgnoreCase(parent, pp, (String) value);
      } else if (p instanceof NotLikePredicate) {
          addNotLike(parent, pp, value);
      } else {
          throw new UnsupportedPredicateException(p);
      }
  }
 
开发者ID:kuali,项目名称:kc-rice,代码行数:39,代码来源:QueryTranslatorBase.java

示例5: addSingleValuePredicate

import org.kuali.rice.core.api.criteria.SingleValuedPredicate; //导入依赖的package包/类
/** adds a single valued predicate to a Criteria. */
private void addSingleValuePredicate(SingleValuedPredicate p, Criteria parent) {
    final Object value = getVal(p.getValue());
    final String pp = p.getPropertyPath();
    if (p instanceof EqualPredicate) {
        parent.addEqualTo(pp, value);
    } else if (p instanceof EqualIgnoreCasePredicate) {
        parent.addEqualTo(genUpperFunc(pp), ((String) value).toUpperCase());
    } else if (p instanceof GreaterThanOrEqualPredicate) {
        parent.addGreaterOrEqualThan(pp, value);
    } else if (p instanceof GreaterThanPredicate) {
        parent.addGreaterThan(pp, value);
    } else if (p instanceof LessThanOrEqualPredicate) {
        parent.addLessOrEqualThan(pp, value);
    } else if (p instanceof LessThanPredicate) {
        parent.addLessThan(pp, value);
    } else if (p instanceof LikePredicate) {
        //no need to convert * or ? since ojb handles the conversion/escaping
        parent.addLike(genUpperFunc(pp), ((String) value).toUpperCase());
    } else if (p instanceof NotEqualPredicate) {
        parent.addNotEqualTo(pp, value);
    } else if (p instanceof NotEqualIgnoreCasePredicate) {
        parent.addNotEqualTo(genUpperFunc(pp), ((String) value).toUpperCase());
    } else if (p instanceof NotLikePredicate) {
        parent.addNotLike(pp, value);
    } else {
        throw new UnsupportedPredicateException(p);
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:30,代码来源:CriteriaLookupDaoOjb.java

示例6: applyPredicate

import org.kuali.rice.core.api.criteria.SingleValuedPredicate; //导入依赖的package包/类
private Predicate applyPredicate(final Predicate input) {
    if (input instanceof PropertyPathPredicate) {
        String pp = ((PropertyPathPredicate) input).getPropertyPath();
        if (isAttributesPredicate(pp)) {
            final String attributeName = pp.substring(pp.indexOf('[') + 1, pp.indexOf(']'));

            final Predicate attrValue;
            if (input instanceof SingleValuedPredicate) {
                final CriteriaValue<?> value = ((SingleValuedPredicate) input).getValue();
                attrValue = dynConstruct(input.getClass().getSimpleName(), ATTRIBUTE_DETAILS_ATTRIBUTE_VALUE, value.getValue());
            } else if (input instanceof MultiValuedPredicate) {
                final Set<? extends CriteriaValue<?>> values = ((MultiValuedPredicate) input).getValues();
                List<Object> l = new ArrayList<Object>();
                for (CriteriaValue<?> v : values) {
                    l.add(v.getValue());
                }

                attrValue = dynConstruct(input.getClass().getSimpleName(), ATTRIBUTE_DETAILS_ATTRIBUTE_VALUE, l.toArray());
            } else {
                attrValue = dynConstruct(input.getClass().getSimpleName(), ATTRIBUTE_DETAILS_ATTRIBUTE_VALUE);
            }
            return and(equal(ATTRIBUTE_DETAILS_ATTRIBUTE_NAME, attributeName), attrValue);
        }
    } else if (input instanceof CompositePredicate) {
        return applyCompositePredicate((CompositePredicate) input);
    }

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

示例7: addSingleValuePredicate

import org.kuali.rice.core.api.criteria.SingleValuedPredicate; //导入依赖的package包/类
/** adds a single valued predicate to a Criteria. */
private void addSingleValuePredicate(SingleValuedPredicate p, Criteria parent) {
    final Object value = getVal(p.getValue());
    final String pp = p.getPropertyPath();
    if (p instanceof EqualPredicate) {
        parent.eq(pp, value);
    } else if (p instanceof EqualIgnoreCasePredicate) {
        parent.eq(genUpperFunc(pp), ((String) value).toUpperCase());
    } else if (p instanceof GreaterThanOrEqualPredicate) {
        parent.gte(pp, value);
    } else if (p instanceof GreaterThanPredicate) {
        parent.gt(pp, value);
    } else if (p instanceof LessThanOrEqualPredicate) {
        parent.lte(pp, value);
    } else if (p instanceof LessThanPredicate) {
        parent.lt(pp, value);
    } else if (p instanceof LikePredicate) {
        //no need to convert * or ? since ojb handles the conversion/escaping
        parent.like(pp, value);
    } else if (p instanceof NotEqualPredicate) {
        parent.ne(pp, value);
    } else if (p instanceof NotEqualIgnoreCasePredicate) {
        parent.ne(genUpperFunc(pp), ((String) value).toUpperCase());
    } else if (p instanceof NotLikePredicate) {
        parent.notLike(pp, value);
    } else {
        throw new UnsupportedPredicateException(p);
    }
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:30,代码来源:CriteriaLookupDaoJpa.java

示例8: apply

import org.kuali.rice.core.api.criteria.SingleValuedPredicate; //导入依赖的package包/类
@Override
public Predicate apply(final Predicate input) {
    if (input instanceof PropertyPathPredicate) {
        String pp = ((PropertyPathPredicate) input).getPropertyPath();
        if (isAttributesPredicate(pp)) {
            final String attributeName = pp.substring(pp.indexOf('[') + 1, pp.indexOf(']'));

            final Predicate attrValue;
            if (input instanceof SingleValuedPredicate) {
                final CriteriaValue<?> value = ((SingleValuedPredicate) input).getValue();
                attrValue = dynConstruct(input.getClass().getSimpleName(), ATTRIBUTE_DETAILS_ATTRIBUTE_VALUE, value.getValue());
            } else if (input instanceof MultiValuedPredicate) {
                final Set<? extends CriteriaValue<?>> values = ((MultiValuedPredicate) input).getValues();
                List<Object> l = new ArrayList<Object>();
                for (CriteriaValue<?> v : values) {
                    l.add(v.getValue());
                }

                attrValue = dynConstruct(input.getClass().getSimpleName(), ATTRIBUTE_DETAILS_ATTRIBUTE_VALUE, l.toArray());
            } else {
                attrValue = dynConstruct(input.getClass().getSimpleName(), ATTRIBUTE_DETAILS_ATTRIBUTE_VALUE);
            }
            return and(equal(ATTRIBUTE_DETAILS_ATTRIBUTE_NAME, attributeName), attrValue);
        }
    }

    return input;
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:29,代码来源:AttributeTransform.java


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