jooq

NUnit 5 Spring MVC test NoSuchBeanDefinitionException for Autowired dependency in submodule

不打扰是莪最后的温柔 提交于 2021-02-11 13:26:53
问题 I have a project with two submodules; one is the data access layer the other is the API service. The data access module uses JOOQ and an autowired DSLContext in a service class. Also, I'm using JUnit 5, and Spring Boot 2.2.4. The QueryService class in the data access module has a member like @Autowired private DSLContext dsl ; The test class is set up like this: @SpringBootTest public class MyServiceTests { @Autowired QueryService service; @Autowired private DSLContext dsl; @Test public void

How to safely execute custom statements within JOOQ's `ExecuteListener`?

六眼飞鱼酱① 提交于 2021-02-10 05:24:38
问题 I have a custom ExecuteListener that executes additional statements before the statement JOOQ is currently looking at: @Override public void executeStart(ExecuteContext ctx) { if (ctx.type() != READ) { Timestamp nowTimestamp = Timestamp.from(Instant.now()); UUID user = auditFields.currentUserId(); // NOT the Postgres user! Connection conn = ctx.connection(); try (Statement auditUserStmt = conn.createStatement(); Statement auditTimestampStmt = conn.createStatement()) { // hand down context

How to safely execute custom statements within JOOQ's `ExecuteListener`?

笑着哭i 提交于 2021-02-10 05:24:05
问题 I have a custom ExecuteListener that executes additional statements before the statement JOOQ is currently looking at: @Override public void executeStart(ExecuteContext ctx) { if (ctx.type() != READ) { Timestamp nowTimestamp = Timestamp.from(Instant.now()); UUID user = auditFields.currentUserId(); // NOT the Postgres user! Connection conn = ctx.connection(); try (Statement auditUserStmt = conn.createStatement(); Statement auditTimestampStmt = conn.createStatement()) { // hand down context

JOOQ pojos with one-to-many and many-to-many relations

情到浓时终转凉″ 提交于 2021-02-08 15:41:45
问题 I am struggling to understand how to handle pojos with one-to-many and many-to-many relationships with JOOQ. I store locations that are created by players (one-to-many relation). A location can hold multiple additional players who may visit it (many-to-many). The database layout comes down to the following: CREATE TABLE IF NOT EXISTS `Player` ( `player-id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `player` BINARY(16) NOT NULL, PRIMARY KEY (`player-id`), UNIQUE INDEX `U_player` (`player` ASC))

Jooq batch record insert

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-07 14:18:27
问题 I'm currently trying to insert in batch many records (~2000) and Jooq's batchInsert is not doing what I want. I'm transforming POJOs into UpdatableRecords and then I'm performing batchInsert which is executing insert for each record. So Jooq is doing ~2000 queries for each batch insert and it's killing database performance. It's executing this code (jooq's batch insert): for (int i = 0; i < records.length; i++) { Configuration previous = ((AttachableInternal) records[i]).configuration(); try

JOOQ: how do I add an interface to a generated Record Class

浪尽此生 提交于 2021-02-06 20:56:53
问题 I am generating a set of JOOQ records from a schema using JOOQ 3.6.4 with Java 8. Some of the tables are reference data that are similarly structured, let's say they have ID, CODE and VALUE columns (they might have other columns, but they all have at least these columns). In my code, not generated by JOOQ, I have an interface "ReferenceData" that defines accessors that match the code that JOOQ generates for these three columns. I want to tell JOOQ to add an "implements ReferenceData" clause

JOOQ: how do I add an interface to a generated Record Class

ε祈祈猫儿з 提交于 2021-02-06 20:45:13
问题 I am generating a set of JOOQ records from a schema using JOOQ 3.6.4 with Java 8. Some of the tables are reference data that are similarly structured, let's say they have ID, CODE and VALUE columns (they might have other columns, but they all have at least these columns). In my code, not generated by JOOQ, I have an interface "ReferenceData" that defines accessors that match the code that JOOQ generates for these three columns. I want to tell JOOQ to add an "implements ReferenceData" clause

JOOQ: how do I add an interface to a generated Record Class

醉酒当歌 提交于 2021-02-06 20:43:47
问题 I am generating a set of JOOQ records from a schema using JOOQ 3.6.4 with Java 8. Some of the tables are reference data that are similarly structured, let's say they have ID, CODE and VALUE columns (they might have other columns, but they all have at least these columns). In my code, not generated by JOOQ, I have an interface "ReferenceData" that defines accessors that match the code that JOOQ generates for these three columns. I want to tell JOOQ to add an "implements ReferenceData" clause

How to include Jooq Code generation in final build

梦想与她 提交于 2021-02-05 09:20:13
问题 I'm using Jooq code generation but I don't include all its java class in source control. That is when one of the developrts pull the code from get he has to run code generation to be up to date with the db schema But how to include it in the final jar? 回答1: There's no difference between that developer that has to run the code generation, and the build server producing the jar files that has to run code generation. Anyone building your application will need to generate code during the build if

How to include Jooq Code generation in final build

安稳与你 提交于 2021-02-05 09:19:07
问题 I'm using Jooq code generation but I don't include all its java class in source control. That is when one of the developrts pull the code from get he has to run code generation to be up to date with the db schema But how to include it in the final jar? 回答1: There's no difference between that developer that has to run the code generation, and the build server producing the jar files that has to run code generation. Anyone building your application will need to generate code during the build if