title: JOOQ: Update column values on null values
body: <p>I need to update the value of an integer column associated with a row using JOOQ on Java. In case the value of the column is not NULL I am aware that I could use this code:</p>
  
  <pre><code>context.update(TABLENAME)
      .set(TABLENAME.COUNTER, TABLENAME.COUNTER.add(incrementValue))
      .where(TABLENAME.ID.eq(id))
      .execute();
  </code></pre>
  
  <p>however if the column value has NULL value I am wondering whether I could do something like the following by setting a default value in presence of NULL:</p>
  
  <pre><code>context.update(TABLENAME)
      .set(TABLENAME.COUNTER, TABLENAME.COUNTER == null ? 0 : TABLENAME.COUNTER.add(incrementValue))
      .where(TABLENAME.ID.eq(id))
      .execute();
  </code></pre>
  
  <p>Is it possible? How should I perform it?</p>
  
  <p>Thanks a lot!</p>