Skip to content

Commit 109ad93

Browse files
SLCORE-1253 Use jooq-codegen
1 parent 9528644 commit 109ad93

File tree

6 files changed

+62
-86
lines changed

6 files changed

+62
-86
lines changed

backend/commons/pom.xml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,54 @@
105105
</resource>
106106
</resources>
107107
<plugins>
108+
<plugin>
109+
<groupId>org.flywaydb</groupId>
110+
<artifactId>flyway-maven-plugin</artifactId>
111+
<executions>
112+
<execution>
113+
<phase>generate-sources</phase>
114+
<goals>
115+
<goal>migrate</goal>
116+
</goals>
117+
</execution>
118+
</executions>
119+
<configuration>
120+
<url>jdbc:h2:${project.build.directory}/db/for-schema-generation.db</url>
121+
<user>user</user>
122+
<locations>
123+
<location>filesystem:src/main/resources/db/migration/</location>
124+
</locations>
125+
</configuration>
126+
</plugin>
127+
<plugin>
128+
<groupId>org.jooq</groupId>
129+
<artifactId>jooq-codegen-maven</artifactId>
130+
<executions>
131+
<execution>
132+
<phase>generate-sources</phase>
133+
<goals>
134+
<goal>generate</goal>
135+
</goals>
136+
</execution>
137+
</executions>
138+
<configuration>
139+
<jdbc>
140+
<driver>org.h2.Driver</driver>
141+
<url>jdbc:h2:${project.build.directory}/db/for-schema-generation.db</url>
142+
<user>user</user>
143+
</jdbc>
144+
<generator>
145+
<database>
146+
<name>org.jooq.meta.h2.H2Database</name>
147+
<inputSchema>PUBLIC</inputSchema>
148+
</database>
149+
<target>
150+
<packageName>org.sonarsource.sonarlint.core.commons.storage.model</packageName>
151+
<directory>${project.build.directory}/generated-sources/jooq</directory>
152+
</target>
153+
</generator>
154+
</configuration>
155+
</plugin>
108156
<plugin>
109157
<groupId>org.apache.maven.plugins</groupId>
110158
<artifactId>maven-jar-plugin</artifactId>

backend/commons/src/main/java/org/sonarsource/sonarlint/core/commons/storage/SonarLintDatabase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import org.jooq.impl.DSL;
3333
import org.sonarsource.sonarlint.core.commons.log.SonarLintLogger;
3434

35-
import static org.sonarsource.sonarlint.core.commons.storage.generated.Tables.AI_CODEFIX_SETTINGS;
35+
import static org.sonarsource.sonarlint.core.commons.storage.model.Tables.AI_CODEFIX_SETTINGS;
3636

3737
public final class SonarLintDatabase {
3838
private static final SonarLintLogger LOG = SonarLintLogger.get();

backend/commons/src/main/java/org/sonarsource/sonarlint/core/commons/storage/generated/Tables.java

Lines changed: 0 additions & 35 deletions
This file was deleted.

backend/commons/src/main/java/org/sonarsource/sonarlint/core/commons/storage/generated/tables/AiCodeFixSettingsTable.java

Lines changed: 0 additions & 48 deletions
This file was deleted.

backend/commons/src/main/java/org/sonarsource/sonarlint/core/commons/storage/repository/AiCodeFixRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import org.sonarsource.sonarlint.core.commons.storage.SonarLintDatabase;
2525
import org.sonarsource.sonarlint.core.commons.storage.model.AiCodeFix;
2626

27-
import static org.sonarsource.sonarlint.core.commons.storage.generated.Tables.AI_CODEFIX_SETTINGS;
27+
import static org.sonarsource.sonarlint.core.commons.storage.model.Tables.AI_CODEFIX_SETTINGS;
2828

2929
/**
3030
* Repository for persisting and retrieving AiCodeFix entity using the local H2 database.

pom.xml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
<properties>
5151
<license.name>GNU LGPL v3</license.name>
52-
52+
5353
<!--
5454
Most of SonarLint Core is build using Java 17 except for the modules that
5555
are dependencies for the SonarLint Core OSGi bundle that is used on
@@ -91,6 +91,7 @@
9191
<sonar.cpd.exclusions>rpc-protocol/src/main/java/org/sonarsource/sonarlint/core/rpc/protocol/client/analysis/*Dto.java</sonar.cpd.exclusions>
9292
<sonar.organization>sonarsource</sonar.organization>
9393
<h2.version>2.4.240</h2.version>
94+
<!-- More recent versions require Java 21 -->
9495
<jooq.version>3.19.15</jooq.version>
9596
<flyway.version>11.14.0</flyway.version>
9697
</properties>
@@ -336,6 +337,16 @@
336337
<artifactId>download-maven-plugin</artifactId>
337338
<version>1.13.0</version>
338339
</plugin>
340+
<plugin>
341+
<groupId>org.jooq</groupId>
342+
<artifactId>jooq-codegen-maven</artifactId>
343+
<version>${jooq.version}</version>
344+
</plugin>
345+
<plugin>
346+
<groupId>org.flywaydb</groupId>
347+
<artifactId>flyway-maven-plugin</artifactId>
348+
<version>${flyway.version}</version>
349+
</plugin>
339350
</plugins>
340351
</pluginManagement>
341352
<plugins>

0 commit comments

Comments
 (0)