genkio / blog

Stay hungry stay foolish
https://slashbit.github.io/blog/
0 stars 1 forks source link

Getting started with jooq #102

Closed genkio closed 7 years ago

genkio commented 8 years ago

A simple workflow (not best practice)

  1. create the schema.sql.

    ALTER TABLE `products` ADD `test_jooq` int(11) NOT NULL DEFAULT '0';
  2. import the schema to your (mysql) database.
  3. complete the jdbc settings in jooq-config.xml.
  4. (IntelliJ idea) create a new run configuration named JOOQ GenerationTool, set the Main Class to org.jooq.util.GenerationTool, and Program Arguments to jooq-config.xml
  5. run the newly created run configuration.
  6. now the necessary code should be generated in the target folder.

observe the generated code:

test_jooq