Java Code Examples for com.querydsl.core.types.dsl.Expressions#stringOperation()

The following examples show how to use com.querydsl.core.types.dsl.Expressions#stringOperation() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: QuerydslQueryBackend.java    From crnk-framework with Apache License 2.0 5 votes vote down vote up
private Expression<?> handleConversions(Expression<?> expression, FilterOperator operator) {
	// convert to String for LIKE operators
	if (expression.getType() != String.class && (operator == FilterOperator.LIKE)) {
		return Expressions.stringOperation(Ops.STRING_CAST, expression);
	}
	else {
		return expression;
	}
}
 
Example 2
Source File: GlobalFilter.java    From spring-data-jpa-datatables with Apache License 2.0 4 votes vote down vote up
@Override
public com.querydsl.core.types.Predicate createPredicate(PathBuilder<?> pathBuilder, String attributeName) {
    StringOperation path = Expressions.stringOperation(Ops.STRING_CAST, pathBuilder.get(attributeName));
    return path.lower().like(escapedRawValue, '~');
}