JOOQ does not generate DAO with flag <daos> set to true
I updated my project, completely rebuilt it, looked for Googled / search StackOverflow for similar problems, read the jOOQ documentation, reviewed the build output for potential problems , etc.
I added the <daos> flag to my pom.xml to create jOOQ database access objects, as the jOOQ 3.2.0 on the Internet says "DAO generation can be activated using the daos flag." According to jOOQ Advanced Codegen, documentation setting this flag to true generates not only DAO, but also relationships, records, and POJOs:
<generator> ... <generate> <daos>true</daos> </generate> </generator> Before adding the flag to my pom, I had auto-generated records and relationships, but neither POJO nor DAO. After adding the daos flag and restoring my project, I also have a POJO plus two others, but I still don't have a DAO. The attached screenshot shows my generated classes. Classes added by the flag are in the blue box . I think there should be a package named "daos" with the classes PurchaseDAO and UserDAO.
The jOOQ DAO documentation does not explain cases when a flag is added, but DAOs are not generated. Part of this project is to learn jOOQ, so manually coding DAO with jOOQ classes will not solve my problem.
EDIT: my SQLite 3.7.11 schema from working and non-working solutions here .
I found on your console output that the DAO is skipping,
INFO: Creating DAO January 16, 2014 12:40:45 org.jooq.tools.JooqLogger info INFO: Skipping generation DAO: BuyDao.java January 16, 2014 12:40:45 org.jooq.tools.JooqLogger info INFO: Skipping generation DAO: UserDao.java January 16, 2014 12:40:45 PM org.jooq.tools.JooqLogger info INFO: DAO tables created: Total: 212.968ms, + 1.759ms
After that cheked code and found the following
// [#2573] Skip DAOs for tables that don't have 1-column-PKs (for now) 1287 if (keyColumn == null) { 1288 log.info("Skipping DAO generation", getStrategy().getFileName(table, Mode.DAO)); 1289 return; 1290 } Today I faced the same problem (2017).
In the configuration file that is used on the command line, for example:
java -classpath jooq-3.10.2.jar:jooq-meta-3.10.2.jar:jooq-codegen-3.10.2.jar:mysql-connector-java-5.1.45-bin.jar:. org.jooq.util.GenerationTool In the configuration.xml place between the "generator" tags the "generate" tag with the parameters accordingly.
eg:
<generator> ... <generate> <pojos>false</pojos> <daos>true</daos> ... </generate> </generator> Read more about these options here .