2

I just want to use JOOQ to generate SQL without it validating tables, columns, etc., and without it generating classes for said tables, columns, etc.

How can I generate a SQL update, and just specify the name of the schema & table with Strings?

Maybe later I'll setup the table-generated Java code, but it's not necessary right now. If I can't use JOOQ without such generated code, then I'll use some other library for now.

Thanks.

Lukas Eder
  • 211,314
  • 129
  • 689
  • 1,509
XDR
  • 4,070
  • 3
  • 30
  • 54

1 Answers1

3

You don't have to use source code generation to use jOOQ's DSL API. See, for instance:

In your case, given you want to generate a SQL update, how about:

// Assuming this static import
import static org.jooq.impl.DSL.*;

using(configuration)
   .update(table("my_table"))
   .set(field("id", Integer.class), 1)
   .set(field("value", String.class), "A")
   .where("x > ?", 3)
   .execute();
Lukas Eder
  • 211,314
  • 129
  • 689
  • 1,509