QueryDsl - generate from database
Im trying to generate classes from an already existing database using QueryDsl.
When I try to generate classes no code is generated.
Pom.xm
My pom file looks like this:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>thinclient-example</groupId>
<artifactId>REDACTED</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<ignite.version>2.6.0</ignite.version>
<querydsl.version>4.2.1</querydsl.version>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
</properties>
<dependencies>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-core</artifactId>
<version>${querydsl.version}</version>
</dependency>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>${querydsl.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-jpa</artifactId>
<version>${querydsl.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-maven-plugin</artifactId>
<version>4.0.3</version>
<executions>
<execution>
<goals>
<goal>export</goal>
</goals>
</execution>
</executions>
<configuration>
<jdbcDriver>com.microsoft.sqlserver.jdbc.SQLServerDriver</jdbcDriver>
<jdbcUrl>jdbc:sqlserver://REDACTED:1433;databaseName=REDACTED;user=REDACTED;password=REDACTED</jdbcUrl>
<tableNamePattern>.*</tableNamePattern>
<packageName>app.domain</packageName>
<exportAll>true</exportAll>
<!-- Source where to put the generated classes -->
<targetFolder>${project.basedir}/src/main/java</targetFolder>
<sourceFolder>${project.basedir}/src/main/java</sourceFolder>
</configuration>
<dependencies>
<!-- database driver dependencies -->
<!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc -->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>7.0.0.jre8</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
However, when I run mvn com.querydsl:querydsl-maven-plugin:4.2.1:export
the command completes successfully, but yet there is no generated code.
What can I do to make this generate tables from the database?
java querydsl
add a comment |
Im trying to generate classes from an already existing database using QueryDsl.
When I try to generate classes no code is generated.
Pom.xm
My pom file looks like this:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>thinclient-example</groupId>
<artifactId>REDACTED</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<ignite.version>2.6.0</ignite.version>
<querydsl.version>4.2.1</querydsl.version>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
</properties>
<dependencies>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-core</artifactId>
<version>${querydsl.version}</version>
</dependency>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>${querydsl.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-jpa</artifactId>
<version>${querydsl.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-maven-plugin</artifactId>
<version>4.0.3</version>
<executions>
<execution>
<goals>
<goal>export</goal>
</goals>
</execution>
</executions>
<configuration>
<jdbcDriver>com.microsoft.sqlserver.jdbc.SQLServerDriver</jdbcDriver>
<jdbcUrl>jdbc:sqlserver://REDACTED:1433;databaseName=REDACTED;user=REDACTED;password=REDACTED</jdbcUrl>
<tableNamePattern>.*</tableNamePattern>
<packageName>app.domain</packageName>
<exportAll>true</exportAll>
<!-- Source where to put the generated classes -->
<targetFolder>${project.basedir}/src/main/java</targetFolder>
<sourceFolder>${project.basedir}/src/main/java</sourceFolder>
</configuration>
<dependencies>
<!-- database driver dependencies -->
<!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc -->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>7.0.0.jre8</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
However, when I run mvn com.querydsl:querydsl-maven-plugin:4.2.1:export
the command completes successfully, but yet there is no generated code.
What can I do to make this generate tables from the database?
java querydsl
Where did you check for generated code? And did you check thetarget/generated-sources
andtarget/generated-test-sources
?
– SimY4
Nov 27 '18 at 5:10
I checked in every folder, and yes, including the ones you mentioned.
– Magick
Nov 27 '18 at 5:44
add a comment |
Im trying to generate classes from an already existing database using QueryDsl.
When I try to generate classes no code is generated.
Pom.xm
My pom file looks like this:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>thinclient-example</groupId>
<artifactId>REDACTED</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<ignite.version>2.6.0</ignite.version>
<querydsl.version>4.2.1</querydsl.version>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
</properties>
<dependencies>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-core</artifactId>
<version>${querydsl.version}</version>
</dependency>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>${querydsl.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-jpa</artifactId>
<version>${querydsl.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-maven-plugin</artifactId>
<version>4.0.3</version>
<executions>
<execution>
<goals>
<goal>export</goal>
</goals>
</execution>
</executions>
<configuration>
<jdbcDriver>com.microsoft.sqlserver.jdbc.SQLServerDriver</jdbcDriver>
<jdbcUrl>jdbc:sqlserver://REDACTED:1433;databaseName=REDACTED;user=REDACTED;password=REDACTED</jdbcUrl>
<tableNamePattern>.*</tableNamePattern>
<packageName>app.domain</packageName>
<exportAll>true</exportAll>
<!-- Source where to put the generated classes -->
<targetFolder>${project.basedir}/src/main/java</targetFolder>
<sourceFolder>${project.basedir}/src/main/java</sourceFolder>
</configuration>
<dependencies>
<!-- database driver dependencies -->
<!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc -->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>7.0.0.jre8</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
However, when I run mvn com.querydsl:querydsl-maven-plugin:4.2.1:export
the command completes successfully, but yet there is no generated code.
What can I do to make this generate tables from the database?
java querydsl
Im trying to generate classes from an already existing database using QueryDsl.
When I try to generate classes no code is generated.
Pom.xm
My pom file looks like this:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>thinclient-example</groupId>
<artifactId>REDACTED</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<ignite.version>2.6.0</ignite.version>
<querydsl.version>4.2.1</querydsl.version>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.8</maven.compiler.source>
</properties>
<dependencies>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-core</artifactId>
<version>${querydsl.version}</version>
</dependency>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-apt</artifactId>
<version>${querydsl.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-jpa</artifactId>
<version>${querydsl.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.querydsl</groupId>
<artifactId>querydsl-maven-plugin</artifactId>
<version>4.0.3</version>
<executions>
<execution>
<goals>
<goal>export</goal>
</goals>
</execution>
</executions>
<configuration>
<jdbcDriver>com.microsoft.sqlserver.jdbc.SQLServerDriver</jdbcDriver>
<jdbcUrl>jdbc:sqlserver://REDACTED:1433;databaseName=REDACTED;user=REDACTED;password=REDACTED</jdbcUrl>
<tableNamePattern>.*</tableNamePattern>
<packageName>app.domain</packageName>
<exportAll>true</exportAll>
<!-- Source where to put the generated classes -->
<targetFolder>${project.basedir}/src/main/java</targetFolder>
<sourceFolder>${project.basedir}/src/main/java</sourceFolder>
</configuration>
<dependencies>
<!-- database driver dependencies -->
<!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc -->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>7.0.0.jre8</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
However, when I run mvn com.querydsl:querydsl-maven-plugin:4.2.1:export
the command completes successfully, but yet there is no generated code.
What can I do to make this generate tables from the database?
java querydsl
java querydsl
asked Nov 27 '18 at 5:02
MagickMagick
75632954
75632954
Where did you check for generated code? And did you check thetarget/generated-sources
andtarget/generated-test-sources
?
– SimY4
Nov 27 '18 at 5:10
I checked in every folder, and yes, including the ones you mentioned.
– Magick
Nov 27 '18 at 5:44
add a comment |
Where did you check for generated code? And did you check thetarget/generated-sources
andtarget/generated-test-sources
?
– SimY4
Nov 27 '18 at 5:10
I checked in every folder, and yes, including the ones you mentioned.
– Magick
Nov 27 '18 at 5:44
Where did you check for generated code? And did you check the
target/generated-sources
and target/generated-test-sources
?– SimY4
Nov 27 '18 at 5:10
Where did you check for generated code? And did you check the
target/generated-sources
and target/generated-test-sources
?– SimY4
Nov 27 '18 at 5:10
I checked in every folder, and yes, including the ones you mentioned.
– Magick
Nov 27 '18 at 5:44
I checked in every folder, and yes, including the ones you mentioned.
– Magick
Nov 27 '18 at 5:44
add a comment |
1 Answer
1
active
oldest
votes
Your filter for table names looks wrong:
<tableNamePattern>.*</tableNamePattern>
Documentation says:
tableNamePattern - a table name pattern in LIKE pattern form; must match the table name as it is stored in the database, multiple can be separated by comma (default: null)
If you need to generate classes for all database tables, then remove tableNamePattern from your configuration or change it to:
<tableNamePattern>%</tableNamePattern>
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53493039%2fquerydsl-generate-from-database%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Your filter for table names looks wrong:
<tableNamePattern>.*</tableNamePattern>
Documentation says:
tableNamePattern - a table name pattern in LIKE pattern form; must match the table name as it is stored in the database, multiple can be separated by comma (default: null)
If you need to generate classes for all database tables, then remove tableNamePattern from your configuration or change it to:
<tableNamePattern>%</tableNamePattern>
add a comment |
Your filter for table names looks wrong:
<tableNamePattern>.*</tableNamePattern>
Documentation says:
tableNamePattern - a table name pattern in LIKE pattern form; must match the table name as it is stored in the database, multiple can be separated by comma (default: null)
If you need to generate classes for all database tables, then remove tableNamePattern from your configuration or change it to:
<tableNamePattern>%</tableNamePattern>
add a comment |
Your filter for table names looks wrong:
<tableNamePattern>.*</tableNamePattern>
Documentation says:
tableNamePattern - a table name pattern in LIKE pattern form; must match the table name as it is stored in the database, multiple can be separated by comma (default: null)
If you need to generate classes for all database tables, then remove tableNamePattern from your configuration or change it to:
<tableNamePattern>%</tableNamePattern>
Your filter for table names looks wrong:
<tableNamePattern>.*</tableNamePattern>
Documentation says:
tableNamePattern - a table name pattern in LIKE pattern form; must match the table name as it is stored in the database, multiple can be separated by comma (default: null)
If you need to generate classes for all database tables, then remove tableNamePattern from your configuration or change it to:
<tableNamePattern>%</tableNamePattern>
answered Nov 27 '18 at 19:09
Piotr PonikowskiPiotr Ponikowski
5115
5115
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53493039%2fquerydsl-generate-from-database%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Where did you check for generated code? And did you check the
target/generated-sources
andtarget/generated-test-sources
?– SimY4
Nov 27 '18 at 5:10
I checked in every folder, and yes, including the ones you mentioned.
– Magick
Nov 27 '18 at 5:44