Closed
Description
Hi,
Is there any way to create a custom predicate with two arguments?
I need to recreate de operator between, for use into dates because my database uses datetime type and I need to truncate the hour to work as expected.
public static RSQLCustomPredicate<Date> customPredicateBetweenDate() {
String nameFunctionDatabase = "BETWEEN";
String nameQueryUrl = "=dbt=";
return new RSQLCustomPredicate<>(new ComparisonOperator( nameQueryUrl ), Date.class, input -> {
Expression<Date> function = input.getCriteriaBuilder().function(nameFunctionDatabase , Date.class, input.getPath());
return input.getCriteriaBuilder().between(function,(Date) input.getArguments().get(0), (Date) input.getArguments().get(1));
});
}
The way above expects just one argument.
Metadata
Metadata
Assignees
Labels
No labels