title: Wrapper for Boolean in NamedQuery
body: <p>I use Oracle SQL and have a table like this:</p>
  
  <pre><code>CREATE table MY_TABLE(
      MY_ID         RAW(16)                                NOT NULL CONSTRAINT MY_ID PRIMARY KEY,
      MY_BOOLEAN    NUMBER DEFAULT 1                       NOT NULL,
      MY_NAME       NUMBER                                 NOT NULL
  );
  </code></pre>
  
  <p><code>MY_BOOLEAN</code> can be <code>0</code> (means false) or <code>1</code> (means true). </p>
  
  <p>My application can search for  values with a <code>NamedQuery</code>. This looks like this:</p>
  
  <pre><code>import javax.persistence.NamedQuery;
  ...
  @NamedQuery(
      name = "MyTable.listAllMatching",
      query = "SELECT COUNT(t) FROM MyTable t WHERE "
              + "LOWER(t.id) LIKE LOWER(:filter) OR "
              + "LOWER(t.myBoolean) LIKE LOWER(:filter) OR "
              + "LOWER(t.myName) LIKE LOWER(:filter)"
  )
  </code></pre>
  
  <p>It works, if I search for the name for example. If I search for <code>true</code>, I want to get all rows in which <code>MY_BOOLEAN</code> is <code>1</code>. Same for <code>false</code> and <code>0</code>. I can't just search for <code>0</code> or <code>1</code> because when I search for <code>0</code> for example, I also get every row which has a <code>0</code> in their <code>MY_ID</code>.</p>
  
  <p>Is there a way to use a wrapper function or whatever to convert the <code>true</code> or <code>false</code> in <code>:filter</code> to <code>0</code> or <code>1</code> just for <code>MY_BOOLEAN</code>? Or is there a better way to do this?</p>