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


Java方法com.mysema.query.types.path.NumberPath.loe代码示例

以下是Java方法com.mysema.query.types.path.NumberPath.loe的代码示例。如果您正苦于以下问题:Java NumberPath.loe方法的具体用法?Java NumberPath.loe怎么用?Java NumberPath.loe使用的例子?那么恭喜您, 这里整理的方法代码示例例程将为您提供帮助。您也可以进一步了解该方法所在com.mysema.query.types.path.NumberPath的用法示例。

本文一共展示了NumberPath.loe的2个开源代码实例,这些例子默认根据受欢迎程度排序。您可以为喜欢的代码打CALL点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createNumericExpression

import com.mysema.query.types.path.NumberPath; //导入方法依赖的package包/类
/**
 * Return an expression for {@code entityPath.fieldName} (for Numerics) with
 * the {@code operator} or "equal" by default.
 * <p/>
 * Expr: {@code entityPath.fieldName eq searchObj}
 * 
 * @param entityPath
 * @param fieldName
 * @param searchObj
 * @param operator
 * @param fieldType
 * @return
 */
@SuppressWarnings({ "rawtypes", "unchecked" })
public static <T> BooleanExpression createNumericExpression(
        PathBuilder<T> entityPath, String fieldName, Object searchObj,
        String operator, Class<?> fieldType) {
    NumberPath numberExpression = null;
    if (BigDecimal.class.isAssignableFrom(fieldType)) {
        numberExpression = entityPath.getNumber(fieldName,
                (Class<BigDecimal>) fieldType);
    }
    else if (BigInteger.class.isAssignableFrom(fieldType)) {
        numberExpression = entityPath.getNumber(fieldName,
                (Class<BigInteger>) fieldType);
    }
    else if (Byte.class.isAssignableFrom(fieldType)) {
        numberExpression = entityPath.getNumber(fieldName,
                (Class<Byte>) fieldType);
    }
    else if (Double.class.isAssignableFrom(fieldType)
            || double.class == fieldType) {
        numberExpression = entityPath.getNumber(fieldName,
                (Class<Double>) fieldType);
    }
    else if (Float.class.isAssignableFrom(fieldType)
            || float.class == fieldType) {
        numberExpression = entityPath.getNumber(fieldName,
                (Class<Float>) fieldType);
    }
    else if (Integer.class.isAssignableFrom(fieldType)
            || int.class == fieldType) {
        numberExpression = entityPath.getNumber(fieldName,
                (Class<Integer>) fieldType);
    }
    else if (Long.class.isAssignableFrom(fieldType)
            || long.class == fieldType) {
        numberExpression = entityPath.getNumber(fieldName,
                (Class<Long>) fieldType);
    }
    else if (Short.class.isAssignableFrom(fieldType)
            || short.class == fieldType) {
        numberExpression = entityPath.getNumber(fieldName,
                (Class<Short>) fieldType);
    }
    if (numberExpression != null) {
        Number value = NumberUtils.createNumber((String) searchObj);
        if (StringUtils.equalsIgnoreCase(operator, OPERATOR_GOE)) {
            return numberExpression.goe(value);
        }
        else if (StringUtils.equalsIgnoreCase(operator, "gt")) {
            return numberExpression.gt(value);
        }
        else if (StringUtils.equalsIgnoreCase(operator, "like")) {
            return numberExpression.like((String) searchObj);
        }
        else if (StringUtils.equalsIgnoreCase(operator, OPERATOR_LOE)) {
            return numberExpression.loe(value);
        }
        else if (StringUtils.equalsIgnoreCase(operator, "lt")) {
            return numberExpression.lt(value);
        }
    }
    return entityPath.get(fieldName).eq(searchObj);
}
 
开发者ID:gvSIGAssociation,项目:gvnix1,完整代码来源:QuerydslUtils.java


示例2: createNumericExpression

import com.mysema.query.types.path.NumberPath; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
public <T> BooleanExpression createNumericExpression(
        PathBuilder<T> entityPath, String fieldName, Object searchObj,
        String operator, Class<?> fieldType) {
    NumberPath numberExpression = null;
    if (BigDecimal.class.isAssignableFrom(fieldType)) {
        numberExpression = entityPath.getNumber(fieldName,
                (Class<BigDecimal>) fieldType);
    }
    else if (BigInteger.class.isAssignableFrom(fieldType)) {
        numberExpression = entityPath.getNumber(fieldName,
                (Class<BigInteger>) fieldType);
    }
    else if (Byte.class.isAssignableFrom(fieldType)) {
        numberExpression = entityPath.getNumber(fieldName,
                (Class<Byte>) fieldType);
    }
    else if (Double.class.isAssignableFrom(fieldType)
            || double.class == fieldType) {
        numberExpression = entityPath.getNumber(fieldName,
                (Class<Double>) fieldType);
    }
    else if (Float.class.isAssignableFrom(fieldType)
            || float.class == fieldType) {
        numberExpression = entityPath.getNumber(fieldName,
                (Class<Float>) fieldType);
    }
    else if (Integer.class.isAssignableFrom(fieldType)
            || int.class == fieldType) {
        numberExpression = entityPath.getNumber(fieldName,
                (Class<Integer>) fieldType);
    }
    else if (Long.class.isAssignableFrom(fieldType)
            || long.class == fieldType) {
        numberExpression = entityPath.getNumber(fieldName,
                (Class<Long>) fieldType);
    }
    else if (Short.class.isAssignableFrom(fieldType)
            || short.class == fieldType) {
        numberExpression = entityPath.getNumber(fieldName,
                (Class<Short>) fieldType);
    }
    if (numberExpression != null) {
        Number value = NumberUtils.createNumber((String) searchObj);
        if (StringUtils.equalsIgnoreCase(operator, OPERATOR_GOE)) {
            return numberExpression.goe(value);
        }
        else if (StringUtils.equalsIgnoreCase(operator, "gt")) {
            return numberExpression.gt(value);
        }
        else if (StringUtils.equalsIgnoreCase(operator, "like")) {
            return numberExpression.like((String) searchObj);
        }
        else if (StringUtils.equalsIgnoreCase(operator, OPERATOR_LOE)) {
            return numberExpression.loe(value);
        }
        else if (StringUtils.equalsIgnoreCase(operator, "lt")) {
            return numberExpression.lt(value);
        }
    }
    return entityPath.get(fieldName).eq(searchObj);
}
 
开发者ID:gvSIGAssociation,项目:gvnix1,完整代码来源:QuerydslUtilsBeanImpl.java



注:本文示例均筛选自Github平台上各路大神开发的开源项目,代码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。