title: JPA / JPQL - bulk update
body: <p>I have to perform a bulk update on a table.
  Making a fast example :</p>
  
  <pre><code> UPDATE Book b SET b.amount = b.amount + 1 WHERE b IN ( :books )
  </code></pre>
  
  <p>The problem is that b.amount can be or a NULL value or an int, and if there is a NULL value it should behave as b.amount would be equal to 1.</p>
  
  <p>Is there any "cast" in JPA/JPQL or any other way to work-around this problem,</p>
  
  <p>Thank you in advance,</p>
  
  <p>Regards,
  P</p>