title: JOOQ: Logically group columns from different tables in common interface
body: <p>We have a table design where a lot of tables share some columns, e.g. in one case some of our tables have the column <code>markedForDeletion</code>. In another case, multiple of our tables have the columns <code>approvedAt</code> and <code>approvedBy</code>. These tables don't share anything in terms of to be JOINED data and thus, I don't like to introduce a common JOIN table for those (It's also not an option due to performance issues).</p>
  
  <p>But from application perspective, I do have quite similar tasks to be performed, here. For instance, if I create a new row, it doesn't matter in which of the tables I insert the entry, I need to extract from the request the approver and the request time to fill that into my table, along with the other line data later on in my code. </p>
  
  <p>In JOOQ, I can now do something like</p>
  
  <pre><code>private void insertApprovalInformation(Record record, RequestContext ctx) {
     record.set(DSL.field("approver"), ctx.getRequestUser());
     record.set(DSL.field("approvedAt"), ctx.getRequestTime());
  }
  </code></pre>
  
  <p>However, I'll loose all my beloved type safety with that approach. 
  Ideally, I'd like to write something like</p>
  
  <pre><code>private void insertApprovalInformation(Approvablerecord record, RequestContext ctx) {
     record.set(ApprovableTable.APPROVER, ctx.getRequestUser());
     record.set(ApprovableTable.APPROVED_AT, ctx.getRequestTime());
  }
  </code></pre>
  
  <p>I am aware that this is similar to the Postgres inheritance feature, but I'd like to have this more database independent and would like to use it in an Oracle database. I imagine something like configuring the JOOQ generator and tell it "These four tables belong to a logical group, which I name "approvable" and they all have the columns <code>APPROVER</code> and <code>APPROVED_AT</code>." which will let JOOQ generate the classes for instance implementing a marker interface for that group. </p>
  
  <p>I think this could be a rather frequently used feature when thinking about historization, common tasks like approval, mark rows for deletion and so on. </p>
  
  <p>My questions:</p>
  
  <ul>
  <li>Is there already a way in JOOQ to achieve a type safe result as I desire?</li>
  <li>Any other suggestions on how to approach this scenarion in a type safe way?</li>
  <li>Or should I just forget about the type-safetyness here?</li>
  </ul>