title: How to use bitwise operators in QueryDSL?
body: <p>Hi,</p>
  
  <p>In my project, I have a bit field flag (int), and i need to query the database using several criteria, one of them is the flag field, and in my Entity I have a field flag which is an enum, the same field could hold multiple values by adding them to each other, and then extract the result I need using &amp; operator.
  For example: In database flag = 4 + 128 = 132
  I need to check if the flag is holding the value of 128 by applying AND operator, so applying the query:
  SELECT * from rate where (flag &amp; 128) > 0
  so what I need is to send a bitwise_AND using Querydsl and spring data jpa.</p>
  
  <p>I tried using QuerydslBinderCustomizer but couldn't find any method which apply any bitwise operator to integers.
  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.</p>
  
  <p>This is an example of what I need:</p>
  
  <pre><code>public interface RateRepository extends CrudRepository&lt;Rate,RatePK&gt;, QueryDslPredicateExecutor&lt;Rate&gt;, QuerydslBinderCustomizer&lt;QRate&gt; {
  
  @Override
  default void customize(QuerydslBindings bindings, QRate qRate) {
      bindings.bind(qRate.rateId).first(
              (path, value) -&gt; {
                  return (path &amp; value &gt; 0) //Something like this, or a function like:
                  //return (bitwise_AND(path, value) &gt; 0);
              });
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I also tried using com.querydsl.core.types.dsl.Expressions and com.querydsl.core.types.Predicate as below:</p>
  
  <pre><code>bindings.bind(qRate.rateFlag).first(
              (path, value) -&gt; {
                  Expression&lt;Integer&gt; intPath = Expressions.asNumber(path);
                  Expression&lt;Integer&gt; rateFlag = Expressions.asNumber(value);
                  Expression&lt;Integer&gt; zeroValue = Expressions.asNumber(0);
                  Expression&lt;Integer&gt; integerExpression = Expressions.numberOperation(Integer.class, Ops.AND, intPath, rateFlag);
                  Predicate predicate  = Expressions.predicate(Ops.GT, integerExpression, zeroValue);
                  return predicate;
              });
  </code></pre>
  
  <p>But i got an invalid operator AND error.</p>
  
  <p>How could this be done?</p>
  
  <p>Thank you.</p>