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


Java StringExpression类代码示例

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


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

示例1: visit

import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
@Override
public Expression<?> visit(Substring node) {
    List<de.fraunhofer.iosb.ilt.sta.query.expression.Expression> params = node.getParameters();
    de.fraunhofer.iosb.ilt.sta.query.expression.Expression p1 = node.getParameters().get(0);
    de.fraunhofer.iosb.ilt.sta.query.expression.Expression p2 = node.getParameters().get(1);
    Expression<?> e1 = p1.accept(this);
    Expression<?> e2 = p2.accept(this);
    StringExpression s1 = getSingleOfType(StringExpression.class, e1);
    NumberExpression n2 = getSingleOfType(NumberExpression.class, e2);
    if (params.size() > 2) {
        de.fraunhofer.iosb.ilt.sta.query.expression.Expression p3 = node.getParameters().get(2);
        Expression<?> e3 = p3.accept(this);
        NumberExpression n3 = getSingleOfType(NumberExpression.class, e3);
        return s1.substring(n2, n3);
    }
    return s1.substring(n2);
}
 
开发者ID:FraunhoferIOSB,项目名称:SensorThingsServer,代码行数:18,代码来源:PgExpressionHandler.java

示例2: checkType

import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
public static <T extends Expression<?>> T checkType(Class<T> expectedClazz, Expression<?> input, boolean canCast) {
    if (expectedClazz.isAssignableFrom(input.getClass())) {
        LOGGER.debug("Is {}: {} ({} -- {})", expectedClazz.getName(), input, input.getClass().getName(), input.getType().getName());
        return expectedClazz.cast(input);
    } else {
        if (canCast && StringExpression.class.equals(expectedClazz) && input instanceof NumberPath) {
            NumberPath numberPath = (NumberPath) input;
            return (T) numberPath.stringValue();
        }
        LOGGER.debug("Not a {}: {} ({} -- {})", expectedClazz.getName(), input, input.getClass().getName(), input.getType().getName());
        throw new IllegalArgumentException("Could not convert parameter of type " + input.getClass().getName() + " to type " + expectedClazz.getName());
    }
}
 
开发者ID:FraunhoferIOSB,项目名称:SensorThingsServer,代码行数:14,代码来源:PgExpressionHandler.java

示例3: createPointWithDefaultSRID

import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
public static GeometryExpression<?> createPointWithDefaultSRID(@Nonnull final NumberPath<Integer> longitude,
                                                               @Nonnull final NumberPath<Integer> latitude) {

    Objects.requireNonNull(longitude, "longitude must not be null");
    Objects.requireNonNull(latitude, "latitude must not be null");

    final StringExpression point = longitude.stringValue()
            .prepend(constant("POINT("))
            .concat(constant(" "))
            .concat(latitude.stringValue())
            .concat(constant(")"));

    return GeometryExpressions.setSRID(fromText(point), SRID.ETRS_TM35FIN.getValue());
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:15,代码来源:GISUtils.java

示例4: customize

import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
@Override
    default public void customize(QuerydslBindings bindings, QCustomer cust) {

//        bindings.bind(cust.firstName).first(StringExpression::containsIgnoreCase);

        bindings
                .bind(String.class)
                .first((SingleValueBinding<StringPath, String>) StringExpression::containsIgnoreCase);

        bindings
                .bind(Long.class)
                .first((SingleValueBinding<NumberPath<Long>, Long>) NumberExpression::goe);

//        bindings.excluding(cust.lastName);
    }
 
开发者ID:Nandtel,项目名称:spring-data-jpa-querydsl-gradle-starter,代码行数:16,代码来源:CustomerRepository.java

示例5: equal

import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
private BooleanExpression equal(StringExpression stringPath, String valueArgument) {
    if (valueArgument.startsWith(WILDCARD) && valueArgument.endsWith(WILDCARD)) {
        return stringPath.containsIgnoreCase(sanitizeWildcard(valueArgument));
    } else if (valueArgument.endsWith(WILDCARD)) {
        return stringPath.startsWithIgnoreCase(sanitizeWildcard(valueArgument));
    } else if (valueArgument.startsWith(WILDCARD)) {
        return stringPath.endsWithIgnoreCase(sanitizeWildcard(valueArgument));
    } else {
        return stringPath.equalsIgnoreCase(valueArgument);
    }
}
 
开发者ID:vineey,项目名称:archelix-rsql,代码行数:12,代码来源:StringPathConverter.java

示例6: ConstantDurationExpression

import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
public ConstantDurationExpression(final StringExpression duration) {
    this.duration = duration;
}
 
开发者ID:FraunhoferIOSB,项目名称:SensorThingsServer,代码行数:4,代码来源:ConstantDurationExpression.java

示例7: getDuration

import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
public StringExpression getDuration() {
    return duration;
}
 
开发者ID:FraunhoferIOSB,项目名称:SensorThingsServer,代码行数:4,代码来源:ConstantDurationExpression.java

示例8: replaceAll

import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
private static StringTemplate replaceAll(StringExpression string, String pattern, String replacement) {
    return _replaceAll(string, pattern, replacement);
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:4,代码来源:HuntingClubNameValidationFeature.java

示例9: handle

import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
private Predicate handle(Expression expression, FilterOperator operator, Object value) { // NOSONAR
	// checking multiple comparision implementations is a mess, created
	// https://github.com/querydsl/querydsl/issues/2028
	if (operator == FilterOperator.EQ || operator == FilterOperator.NEQ) {
		return handleEquals(expression, operator, value);
	}
	else if (operator == FilterOperator.LIKE) {
		return ((StringExpression) expression).lower().like(value.toString().toLowerCase());
	}
	else if (operator == FilterOperator.GT) {
		if (expression instanceof FetchableSubQueryBase) {
			return ((FetchableSubQueryBase) expression).gt((Number) value);
		}
		else if (expression instanceof NumberExpression) {
			return ((NumberExpression) expression).gt((Number) value);
		}
		else {
			return ((ComparableExpression) expression).gt((Comparable) value);
		}
	}
	else if (operator == FilterOperator.LT) {
		if (expression instanceof FetchableSubQueryBase) {
			return ((FetchableSubQueryBase) expression).lt((Number) value);
		}
		else if (expression instanceof NumberExpression) {
			return ((NumberExpression) expression).lt((Number) value);
		}
		else {
			return ((ComparableExpression) expression).lt((Comparable) value);
		}
	}
	else if (operator == FilterOperator.GE) {
		if (expression instanceof FetchableSubQueryBase) {
			return ((FetchableSubQueryBase) expression).goe((Number) value);
		}
		else if (expression instanceof NumberExpression) {
			return ((NumberExpression) expression).goe((Number) value);
		}
		else {
			return ((ComparableExpression) expression).goe((Comparable) value);
		}
	}
	else if (operator == FilterOperator.LE) {
		if (expression instanceof FetchableSubQueryBase) {
			return ((FetchableSubQueryBase) expression).loe((Number) value);
		}
		else if (expression instanceof NumberExpression) {
			return ((NumberExpression) expression).loe((Number) value);
		}
		else {
			return ((ComparableExpression) expression).loe((Comparable) value);
		}
	}
	else {
		throw new IllegalStateException("unexpected operator " + operator);
	}

}
 
开发者ID:katharsis-project,项目名称:katharsis-framework,代码行数:59,代码来源:QuerydslQueryBackend.java

示例10: customize

import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
@Override
default public void customize(QuerydslBindings bindings, QCustomer root) {
    bindings.bind(String.class).first((SingleValueBinding<StringPath, String>) StringExpression::startsWithIgnoreCase);
    bindings.bind(Long.class).first((SingleValueBinding<NumberPath<Long>, Long>) NumberExpression::in);
}
 
开发者ID:bulktrade,项目名称:SMSC,代码行数:6,代码来源:CustomerRepository.java

示例11: customize

import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
@Override
default public void customize(QuerydslBindings bindings, QContact root) {
    bindings.bind(String.class).first((SingleValueBinding<StringPath, String>) StringExpression::containsIgnoreCase);
}
 
开发者ID:bulktrade,项目名称:SMSC,代码行数:5,代码来源:ContactRepository.java

示例12: customize

import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
@Override
default public void customize(QuerydslBindings bindings, QUser root) {
    bindings.bind(String.class).first((SingleValueBinding<StringPath, String>) StringExpression::containsIgnoreCase);
    bindings.excluding(root.password);
}
 
开发者ID:bulktrade,项目名称:SMSC,代码行数:6,代码来源:UserRepository.java

示例13: customize

import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
@Override
default public void customize(QuerydslBindings bindings, QGroup root) {
    bindings.bind(String.class).first((SingleValueBinding<StringPath, String>) StringExpression::containsIgnoreCase);
}
 
开发者ID:bulktrade,项目名称:SMSC,代码行数:5,代码来源:GroupRepository.java

示例14: customize

import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
@Override
default public void customize(QuerydslBindings bindings, QRole root) {
    bindings.bind(String.class).first((SingleValueBinding<StringPath, String>) StringExpression::containsIgnoreCase);
}
 
开发者ID:bulktrade,项目名称:SMSC,代码行数:5,代码来源:RoleRepository.java

示例15: customize

import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
@Override
default public void customize(QuerydslBindings bindings, QAuthority root) {
    bindings.bind(String.class).first((SingleValueBinding<StringPath, String>) StringExpression::containsIgnoreCase);
}
 
开发者ID:bulktrade,项目名称:SMSC,代码行数:5,代码来源:AuthorityRepository.java


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