本文整理汇总了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);
}
示例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());
}
}
示例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());
}
示例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);
}
示例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);
}
}
示例6: ConstantDurationExpression
import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
public ConstantDurationExpression(final StringExpression duration) {
this.duration = duration;
}
示例7: getDuration
import com.querydsl.core.types.dsl.StringExpression; //导入依赖的package包/类
public StringExpression getDuration() {
return duration;
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}