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.

1

1 Answer 1

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();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.