title: JOOQ: How to best access columns polymorphically?
body: <p>Our scenario is very similar to <a href="https://stackoverflow.com/q/52524694/8707976">this question</a>. We have tables that are &quot;deletable&quot;, meaning they have an additional set of columns related to deletion, such as &quot;DELETED&quot;, &quot;DELETED_BY&quot; etc. Now what we'd like to do is:</p>
  <pre><code>dsl.select()
    .from(CUSTOMER)
    .where(createDeletedCondition(CUSTOMER, currentUserId))
  </code></pre>
  <p>with <code>createDeletedCondition</code> being a method that can be applied to all deletable tables:</p>
  <pre><code>public static Condidtion createDeletedCondition(final IDeletableTable deletableTable, final UUID currentUserId) {
    return deletableTable.DELETED.isTrue().and(deletableTable.DELETED_BY.eq(currentUserId));
  }
  </code></pre>
  <p>Right now we're accessing the fields by explicitly naming them (<code>deletableTable.getField(&quot;deleted_by&quot;)</code>), which seems awkward and not safe against refactorings. Maybe there's a better way to do this?</p>