當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。