Search code examples
jooq

Get underlying non-aliased table from aliased table in jOOQ


I have an aliased table

Author a = AUTHOR.as("a");

and I'm trying to access the underlying table AUTHOR from a but cant see how to.

I've tried a.alias.wrapped but that doesn't work for me


Solution

  • The underlying table is not exposed via the Aliased table and so you can't get it.

    Instead if trying to get check if the Aliased table is a certain type (which was the original reason I wanted the underlying table) you can do

    if (a is Author) {
     // Do Something
    }