Last active
June 21, 2025 00:33
-
-
Save c0ldd/2e1263598171d82b31040e752185f16d to your computer and use it in GitHub Desktop.
querydsl-sql with H2 tables generated from liquibase scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// configured plugins in pom.xml | |
<plugin> | |
<groupId>org.liquibase</groupId> | |
<artifactId>liquibase-maven-plugin</artifactId> | |
<version>3.4.2</version> | |
<configuration> | |
<promptOnNonLocalDatabase>false</promptOnNonLocalDatabase> | |
<defaultSchemaName>MYSCHEMA</defaultSchemaName> | |
<changeLogFile>src/main/resources/db/master.changelog.xml</changeLogFile> | |
<url>jdbc:h2:./target/tl_tables;AUTO_SERVER=TRUE;MV_STORE=FALSE;MVCC=FALSE;INIT=create schema IF NOT EXISTS MYSCHEMA</url> | |
<driver>org.h2.Driver</driver> | |
</configuration> | |
<executions> | |
<execution> | |
<phase>initialize</phase> | |
<goals> | |
<goal>update</goal> | |
</goals> | |
</execution> | |
</executions> | |
</plugin> | |
<plugin> | |
<groupId>com.mysema.querydsl</groupId> | |
<artifactId>querydsl-maven-plugin</artifactId> | |
<version>3.7.4</version> | |
<executions> | |
<execution> | |
<goals> | |
<goal>export</goal> | |
</goals> | |
</execution> | |
</executions> | |
<configuration> | |
<jdbcDriver>org.h2.Driver</jdbcDriver> | |
<jdbcUrl>jdbc:h2:${project.basedir}/target/tl_tables;AUTO_SERVER=TRUE</jdbcUrl> | |
<packageName>my.test.db</packageName> | |
<tableNamePattern>TABELE1,TABLE2<!--your tables here--></tableNamePattern> | |
<targetFolder>${project.basedir}/target/generated-sources/java</targetFolder> | |
</configuration> | |
<dependencies> | |
<dependency> | |
<groupId>com.h2database</groupId> | |
<artifactId>h2</artifactId> | |
<version>1.4.196</version> | |
</dependency> | |
</dependencies> | |
</plugin> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Impressive idea and I followed the same but it does not work with latest Spring boot, so I have changed a bit.