JFinal代码生成器不兼容postgres 的问题

mcleavin 发布于 2016/11/29 14:34
阅读 478
收藏 0

@JFinal 你好,想跟你请教个问题:

GeneratorDemo.java,不支持postgres(9.6);

单表代码生成时_MappingKit 中 mapping 重复,还有不存在的表。

多表时,报以下错误:

十一月 29, 2016 2:23:13 下午 com.mchange.v2.log.MLog 
信息: MLog clients using java 1.4+ standard logging.
十一月 29, 2016 2:23:13 下午 com.mchange.v2.c3p0.C3P0Registry 
信息: Initializing c3p0-0.9.5.1 [built 16-June-2015 00:06:36 -0700; debug? true; trace: 10]
Build TableMeta ...
十一月 29, 2016 2:23:13 下午 com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource 
信息: Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 2, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, contextClassLoaderSource -> caller, dataSourceName -> 1hge0ye9k1chjky41r6d90n|4d50c296, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> org.postgresql.Driver, extensions -> {}, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceSynchronousCheckins -> false, forceUseNamedDriverClass -> false, identityToken -> 1hge0ye9k1chjky41r6d90n|4d50c296, idleConnectionTestPeriod -> 0, initialPoolSize -> 10, jdbcUrl -> jdbc:postgresql://127.0.0.1:5432/postgres, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 20, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 100, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 10, numHelperThreads -> 3, preferredTestQuery -> null, privilegeSpawnedThreads -> false, properties -> {user=******, password=******}, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, userOverrides -> {}, usesTraditionalReflectiveProxies -> false ]
Exception in thread "main" java.lang.RuntimeException: org.postgresql.util.PSQLException: 错误: 语法错误 在 "`" 或附近的
  位置:15
at com.jfinal.plugin.activerecord.generator.MetaBuilder.build(MetaBuilder.java:102)
at com.jfinal.plugin.activerecord.generator.Generator.generate(Generator.java:210)
at com.demo.common.model.GeneratorDemo.main(GeneratorDemo.java:54)
Caused by: org.postgresql.util.PSQLException: 错误: 语法错误 在 "`" 或附近的
  位置:15
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2455)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2155)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:288)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:430)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:356)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:303)
at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:289)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:266)
at org.postgresql.jdbc.PgStatement.executeQuery(PgStatement.java:233)
at com.mchange.v2.c3p0.impl.NewProxyStatement.executeQuery(NewProxyStatement.java:327)
at com.jfinal.plugin.activerecord.generator.MetaBuilder.buildColumnMetas(MetaBuilder.java:216)
at com.jfinal.plugin.activerecord.generator.MetaBuilder.build(MetaBuilder.java:97)
... 2 more


加载中
0
JFinal
JFinal
通过 generator.setDialect(new PostgreSqlDialect()) 即可极速打完收工
m
mcleavin
回复@JFinal :波总,谢谢。表非public的模式中,Postgres没有开启免模式,才导致的问题。
m
mcleavin
回复@JFinal : 以上情况是在已经用上 generator.setDialect(new PostgreSqlDialect()) 的情况出现的
littleant
littleant
波总,这两天没上QQ么,好久不见你群里冒泡了,昨天给你留言了也没见你回话
返回顶部
顶部