无法从 Jooq 生成表 Jooq 配置 jooq.properties for postgresql

发布于 2024-11-24 01:20:06 字数 3809 浏览 1 评论 0原文

我已经从 MySQL 表生成了 java 模型文件。但现在我们正在切换到 PostgreSQL,我需要一切才能在那里工作。所以我为 PostgreSQL 配置创建了一个新的 jooq.properties 文件。但是,它不会从表中生成任何模型文件。

PostgreSQL 的 jooq.properties 文件是

#Configure the database connection here
jdbc.Driver=org.postgresql.Driver
jdbc.URL=jdbc:postgresql://localhost/ofbiz_olo
jdbc.Schema=public
jdbc.User=postgres
jdbc.Password=standard

#The default code generator. You can override this one, to generate your own code style
generator=org.jooq.util.DefaultGenerator

#The database type. The format here is:
#generator.database=org.util.[database].[database]Database
generator.database=org.jooq.util.postgres.PostgresDatabase

#All elements that are generated from your schema (several Java regular expressions, separated by comma)
generator.database.includes=OLO.*,USER_LOGIN,PRODUCT,PERSON

#All elements that are excluded from your schema (several Java regular expressions, separated by comma). Excludes match before includes
generator.database.excludes=

#Primary key / foreign key relations should be generated and used. 
#This will be a prerequisite for various advanced features
generator.generate.relations=true

#The destination package of your generated classes (within the destination directory)
generator.target.package=com.olo.base.model

#The destination directory of your generated classes
generator.target.directory=src

我在命令行中得到的输出是

INFO: Initialising properties  : /jooq.properties
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO: Database parameters      
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO: ----------------------------------------------------------
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO:   dialect                : POSTGRES
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO:   schema                 : public
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO:   target dir             : src
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO:   target package         : com.olo.base.model
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO: ----------------------------------------------------------
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO: Emptying                 : /home/shekhar/Projects/olo_sf_base/src/com/olo/base/model
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO: Generating classes in    : /home/shekhar/Projects/olo_sf_base/src/com/olo/base/model
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO: Generating schema        : Public.java
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO: Generating factory       : PublicFactory.java
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO: Schema generated         : Total: 67.978ms
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO: Sequences fetched        : 0
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO: Masterdata tables fetched: 0
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO: Tables fetched           : 0
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO: UDTs fetched             : 0
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO: ARRAYs fetched           : 0
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO: Enums fetched            : 0
14 Jul, 2011 8:41:12 PM org.jooq.impl.JooqLogger info
INFO: Procedures fetched       : 0
14 Jul, 2011 8:41:12 PM org.jooq.impl.JooqLogger info
INFO: Functions fetched        : 0
14 Jul, 2011 8:41:12 PM org.jooq.impl.JooqLogger info
INFO: Packages fetched         : 0
14 Jul, 2011 8:41:12 PM org.jooq.impl.JooqLogger info
INFO: GENERATION FINISHED!     : Total: 728.67ms, +660.692ms

pgAdmin3 中的 PostgreSQL 信息,看起来像 pgsql->databases->ofbiz_olo->Schemas->public->Tables

I have generated the java model files from MySQL tables. But now we are switching to PostgreSQL and i need everything to work there. So i have created a new jooq.properties files for PostgreSQL configuration. However it does not generate any model files from the table.

The jooq.properties file for PostgreSQL is

#Configure the database connection here
jdbc.Driver=org.postgresql.Driver
jdbc.URL=jdbc:postgresql://localhost/ofbiz_olo
jdbc.Schema=public
jdbc.User=postgres
jdbc.Password=standard

#The default code generator. You can override this one, to generate your own code style
generator=org.jooq.util.DefaultGenerator

#The database type. The format here is:
#generator.database=org.util.[database].[database]Database
generator.database=org.jooq.util.postgres.PostgresDatabase

#All elements that are generated from your schema (several Java regular expressions, separated by comma)
generator.database.includes=OLO.*,USER_LOGIN,PRODUCT,PERSON

#All elements that are excluded from your schema (several Java regular expressions, separated by comma). Excludes match before includes
generator.database.excludes=

#Primary key / foreign key relations should be generated and used. 
#This will be a prerequisite for various advanced features
generator.generate.relations=true

#The destination package of your generated classes (within the destination directory)
generator.target.package=com.olo.base.model

#The destination directory of your generated classes
generator.target.directory=src

The output that i get in commandline is

INFO: Initialising properties  : /jooq.properties
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO: Database parameters      
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO: ----------------------------------------------------------
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO:   dialect                : POSTGRES
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO:   schema                 : public
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO:   target dir             : src
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO:   target package         : com.olo.base.model
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO: ----------------------------------------------------------
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO: Emptying                 : /home/shekhar/Projects/olo_sf_base/src/com/olo/base/model
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO: Generating classes in    : /home/shekhar/Projects/olo_sf_base/src/com/olo/base/model
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO: Generating schema        : Public.java
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO: Generating factory       : PublicFactory.java
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO: Schema generated         : Total: 67.978ms
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO: Sequences fetched        : 0
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO: Masterdata tables fetched: 0
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO: Tables fetched           : 0
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO: UDTs fetched             : 0
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO: ARRAYs fetched           : 0
14 Jul, 2011 8:41:11 PM org.jooq.impl.JooqLogger info
INFO: Enums fetched            : 0
14 Jul, 2011 8:41:12 PM org.jooq.impl.JooqLogger info
INFO: Procedures fetched       : 0
14 Jul, 2011 8:41:12 PM org.jooq.impl.JooqLogger info
INFO: Functions fetched        : 0
14 Jul, 2011 8:41:12 PM org.jooq.impl.JooqLogger info
INFO: Packages fetched         : 0
14 Jul, 2011 8:41:12 PM org.jooq.impl.JooqLogger info
INFO: GENERATION FINISHED!     : Total: 728.67ms, +660.692ms

PostgreSQL information in pgAdmin3 looks like pgsql->databases->ofbiz_olo->Schemas->public->Tables

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

百思不得你姐 2024-12-01 01:20:06

jOOQ 1.x 的历史答案:

也许,尝试(小写字母)

generator.database.includes=olo.*,user_login,product,person

或者甚至

generator.database.includes=.*

Historic answer for jOOQ 1.x:

Maybe, try (lower-case letters)

generator.database.includes=olo.*,user_login,product,person

Or even

generator.database.includes=.*
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文