2017-10-30 16:55 GMT+01:00 <[email protected]>: > Great, looks like exactly what I was looking for! Sorry for missing that > in the documentation, it's really vast and I probably skipped this small > chapter :) >
No worries, it's not the main use-case. In most cases, you can still do dynamic SQL with the DSL API: https://www.jooq.org/doc/latest/manual/sql-building/dynamic-sql Only when you need to add entire clauses conditionally, things get hairy with the DSL API. > Is the following a correct way to get a SelectQuery without a DSLContext? > I'd prefer to keep this class a mere transformer, not aware of any > contexts, dialects and moreover database connections. > SelectQuery<Record> select = DSL.select( fieldsList ) > .from( table ) > .getQuery(); > > Yes, that's one way. An alternative way is to create a DSLContext that is not connected to anything: DSL.using(new DefaultConfiguration()).selectQuery(); Hope this helps, Lukas -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
