I have generated a number of JOOQ classes from my database. I want to easily filter my tables by customer while maintaining the strong type of my tables.
This is what I want to be able to do:
// Generated class books JBooks books = JBooks.BOOKS; // get ownershipCheck (this could be more complicated, possibly joining multiple tables) Condition ownershipCheck = books.customer().ID.eq(currentCustomer); // desired output that I can do further operations on JBooks filteredBooks = selectFrom(books).where(ownershipCheck).asTable(); // a bunch of random operations using the functionality from JBooks db.select(filteredBooks.AUTHOR, filteredBooks.PUBLISH_DATE, ...etc)
Unfortunately, I can’t do this. I get a
Table<JSubscriberUsageCdrRecord> instead and I see no way to cast my new Table to