title: Generate jOOQ classes from pure Java
body: <p>Is there a way to generate jOOQ classes from pure Java code? If not, what would be the closest alternative? Ideally, I'd like to do this in a gradle build.</p>
  
  <p>I have found <a href="https://stackoverflow.com/a/27088231/1296709">this answer</a>, which links to <a href="http://vladmihalcea.com/jooq-facts-from-jpa-annotations-to-jooq-table-mappings/" rel="nofollow noreferrer">this blog post</a>. The essence of that post is this:</p>
  
  <ol>
  <li>Start with a JPA Model</li>
  <li>Convert it to a DDL script (.sql file full of <code>CREATE</code> statements)</li>
  <li>Create a fresh HSQLDB file, and fill it with tables by running that DDL script on it. Save the resulting DB to disk.</li>
  <li>Load that DB from disk and run jOOQ code generation on it</li>
  <li>use the resulting generated jOOQ classes.</li>
  </ol>
  
  <p>There are three things that bother me about this approach:</p>
  
  <ul>
  <li>That blog post does everything in Maven (&amp; Ant). I'd like to use Gradle, but I can work around this.</li>
  <li>I have to start with JPA. I'd prefer starting with a pure jOOQ definition of my schema. Does jOOQ have a schema definition DSL/API?</li>
  <li>The intermediate steps (DDL script, and HSQLDB creation) are not needed as an end product. Instead, they are only needed to convert the JPA model into something jOOQ understands as an input. There should be a tidier (java-only) way, even if jOOQ doesn't have its own schema definition API. Is there one?</li>
  </ul>