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


Java CriteriaValue類代碼示例

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


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

示例1: getVal

import org.kuali.rice.core.api.criteria.CriteriaValue; //導入依賴的package包/類
/**
* Converts any {@link DateTime} values to {@link Timestamp}s.
*
* @param toConv the {@link CriteriaValue} to convert.
* @param <U> the type of the {@link CriteriaValue}.
* @return the {@link CriteriaValue} converted.
*/
  protected static <U extends CriteriaValue<?>> Object getVal(U toConv) {
      Object o = toConv.getValue();
      if (o instanceof DateTime) {
          return new Timestamp(((DateTime) o).getMillis());
      }
      return o;
  }
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:15,代碼來源:QueryTranslatorBase.java

示例2: getVals

import org.kuali.rice.core.api.criteria.CriteriaValue; //導入依賴的package包/類
/**
 * Converts a set of {@link CriteriaValue}s to an undefined type.
 *
 * @param toConv the {@link CriteriaValue} to convert.
 * @return a set of {@link CriteriaValue}s as an undefined type.
 */
protected static Set<?> getVals(Set<? extends CriteriaValue<?>> toConv) {
    final Set<Object> values = new HashSet<Object>();
    for (CriteriaValue<?> value : toConv) {
        values.add(getVal(value));
    }
    return values;
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:14,代碼來源:QueryTranslatorBase.java

示例3: getVal

import org.kuali.rice.core.api.criteria.CriteriaValue; //導入依賴的package包/類
private static <U extends CriteriaValue<?>> Object getVal(U toConv) {
    Object o = toConv.getValue();
    if (o instanceof DateTime) {
        return new Timestamp(((DateTime) o).getMillis());
    }
    return o;
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:8,代碼來源:CriteriaLookupDaoOjb.java

示例4: getVals

import org.kuali.rice.core.api.criteria.CriteriaValue; //導入依賴的package包/類
private static Set<?> getVals(Set<? extends CriteriaValue<?>> toConv) {
    final Set<Object> values = new HashSet<Object>();
    for (CriteriaValue<?> value : toConv) {
        values.add(getVal(value));
    }
    return values;
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:8,代碼來源:CriteriaLookupDaoOjb.java

示例5: applyPredicate

import org.kuali.rice.core.api.criteria.CriteriaValue; //導入依賴的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

示例6: apply

import org.kuali.rice.core.api.criteria.CriteriaValue; //導入依賴的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

示例7: getValsUnsafe

import org.kuali.rice.core.api.criteria.CriteriaValue; //導入依賴的package包/類
@SuppressWarnings("unchecked")
private static <T, U extends CriteriaValue<T>> Set<T> getValsUnsafe(Set<? extends U> toConv) {
    return (Set<T>) getVals(toConv);
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:5,代碼來源:CriteriaLookupDaoOjb.java

示例8: getValsUnsafe

import org.kuali.rice.core.api.criteria.CriteriaValue; //導入依賴的package包/類
/**
 * Converts a set of {@link CriteriaValue}s.
 *
 * <p>This is unsafe because values could be converted resulting in a class cast exception.</p>
 *
 * @param toConv the {@link CriteriaValue} to convert.
 * @param <U> the initial type of the {@link CriteriaValue} set.
 * @param <T> the final type of the {@link CriteriaValue} set.
 * @return the {@link CriteriaValue} set converted.
 */
@SuppressWarnings("unchecked")
protected static <T, U extends CriteriaValue<T>> Set<T> getValsUnsafe(Set<? extends U> toConv) {
    return (Set<T>) getVals(toConv);
}
 
開發者ID:kuali,項目名稱:kc-rice,代碼行數:15,代碼來源:QueryTranslatorBase.java


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