Hi,
In my project, i have a bit field (int) named flag, and i need to query the database using several criteria, one of them is the flag field, so what i need is to send a bitwise_AND.
I tried using QuerydslBinderCustomizer but couldn't find any method which apply any bitwise operator.
I also tried to create a custom BooleanExpression to return it to the bindings.bind which apply the bitwise operator manually, but also it didn't work.
This is an example of what I need:
public interface RateRepository extends CrudRepository<Rate,RatePK>, QueryDslPredicateExecutor<Rate>, QuerydslBinderCustomizer<QRate> {
default void customize(QuerydslBindings bindings, QRate qRate) {
bindings.bind(qRate.rateId).first(
(path, value) -> {
return (path & value > 0) //Something like this, or a function like:
//return (bitwise_AND(path, value) > 0);
});
}
}
How could this be done?
Thank you.