我从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-> of public-> Tables
答案 0 :(得分:3)
也许,试试(小写字母)
generator.database.includes=olo.*,user_login,product,person
甚至
generator.database.includes=.*