gpt4 book ai didi

java - jOOQ不想生成数据库资源

转载 作者:行者123 更新时间:2023-12-02 02:52:31 24 4
gpt4 key购买 nike

即使数据库中有表,jOOQ 也不会从数据库生成资源。

我已经检查过这个thread但在更改 org.jooq.meta.sqlite.SQLiteDatabase 时出现错误

我还让代码自行生成数据库并稍后添加表,但再次运行时它仍然没有生成任何内容

jOOQ版本为3.11.11

pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<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>com.db</groupId>
<artifactId>test</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.jooq</groupId>
<artifactId>jooq</artifactId>
<version>3.11.11</version>
</dependency>
<dependency>
<groupId>org.jooq</groupId>
<artifactId>jooq-meta</artifactId>
<version>3.11.11</version>
</dependency>
<dependency>
<groupId>org.jooq</groupId>
<artifactId>jooq-codegen</artifactId>
<version>3.11.11</version>
</dependency>

</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.jooq</groupId>
<artifactId>jooq-codegen-maven</artifactId>
<version>3.11.11</version>

<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>

<dependencies>
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.27.2.1</version>
</dependency>
</dependencies>

<configuration>
<jdbc>
<driver>org.sqlite.JDBC</driver>
<url>jdbc:sqlite:TestDB.db</url>
</jdbc>
<generator>
<database>
<name>org.jooq.meta.sqlite.SQLiteDatabase</name>
<includes>.*</includes>
<excludes></excludes>
<inputSchema>public</inputSchema>
</database>
<target>
<packageName>test.generatedclasses</packageName>
<directory>${basedir}\src\main\java</directory>
</target>
</generator>
</configuration>
</plugin>
</plugins>
</build>
</project>```

I also get this:
[INFO] annotations (generated): true
[INFO] annotations (JPA: any) : false
[INFO] annotations (JPA: version):
[INFO] annotations (validation): false
[INFO] comments : true
[INFO] comments on attributes : true
[INFO] comments on catalogs : true
[INFO] comments on columns : true
[INFO] comments on keys : true
[INFO] comments on links : true
[INFO] comments on packages : true
[INFO] comments on parameters : true
[INFO] comments on queues : true
[INFO] comments on routines : true
[INFO] comments on schemas : true
[INFO] comments on sequences : true
[INFO] comments on tables : true
[INFO] comments on udts : true
[INFO] daos : false
[INFO] deprecated code : true
[INFO] global references (any): true
[INFO] global references (catalogs): true
[INFO] global references (keys): true
[INFO] global references (links): true
[INFO] global references (queues): true
[INFO] global references (routines): true
[INFO] global references (schemas): true
[INFO] global references (sequences): true
[INFO] global references (tables): true
[INFO] global references (udts): true
[INFO] indexes : true
[INFO] instance fields : true
[INFO] interfaces : false
[INFO] interfaces (immutable) : false
[INFO] javadoc : true
[INFO] keys : true
[INFO] links : true
[INFO] pojos : false
[INFO] pojos (immutable) : false
[INFO] queues : true
[INFO] records : true
[INFO] routines : true
[INFO] sequences : true
[INFO] table-valued functions : true
[INFO] tables : true
[INFO] udts : true
[INFO] relations : true

I have also executed "SELECT FROM" query and it worked fine

最佳答案

SQLite 不支持模式。删除您的 <inputSchema>

关于java - jOOQ不想生成数据库资源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57099276/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com