WorldStarWB / rapid-framework

Automatically exported from code.google.com/p/rapid-framework
0 stars 0 forks source link

利用代码生成oracle数据,有问题。请看看 #28

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago

2009-11-25 17:34:11,109 WARN [cn.org.rapid_framework.generator.Generator] -
 <WARNING: The JDBC driver didn't report any primary key columns in 
TXN_LOG>
***************************************************************
* BEGIN generate Database Table:TXN_LOG to ClassName:TxnLog
***************************************************************
-------------------load template from templateRootDir = 'E:\j2ee\myeclipse6
\eclipse\workspace\wcode\template'
[skip]       endsWith '.include' template:custom.include
[generate]   template:insert_demo\i18n.properties to 
insert_demo\i18n.properties
[generate]   template:insert_demo\spring-service.xml to 
insert_demo\spring-service.xml
[skip]       endsWith '.include' template:java_copyright.include
[skip]       endsWith '.include' template:java_imports.include
[generate]   template:java_src\${basepackage_dir}\action\${className}
Action.java to java_src\com/company/project\action\TxnLogAction.java
[generate]   template:java_src\${basepackage_dir}\dao\${className}
Dao.java to java_src\com/company/project\dao\TxnLogDao.java
2009-11-25 17:34:11,437 ERROR [freemarker.runtime] - <>

Expression table.idColumn is undefined on line 12, column 67 in 
java_src\${basepackage_dir}\dao\${className}Dao.java.
The problematic instruction:
----------
==> ${table.idColumn.javaType} [on line 12, column 65 in 
java_src\${basepackage_dir}\dao\${className}Dao.java]
----------

Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: Expression table.idColumn is 
undefined on line 12, column 67 in java_src\${basepackage_dir}
\dao\${className}Dao.java.
    at freemarker.core.TemplateObject.assertNonNull
(TemplateObject.java:124)
    at freemarker.core.TemplateObject.invalidTypeException
(TemplateObject.java:134)
    at freemarker.core.Dot._getAsTemplateModel(Dot.java:78)
    at freemarker.core.Expression.getAsTemplateModel
(Expression.java:89)
    at freemarker.core.Expression.getStringValue(Expression.java:93)
    at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
    at freemarker.core.Environment.visit(Environment.java:208)
    at freemarker.core.MixedContent.accept(MixedContent.java:92)
    at freemarker.core.Environment.visit(Environment.java:208)
    at freemarker.core.Environment.process(Environment.java:188)
    at freemarker.template.Template.process(Template.java:237)
    at 
cn.org.rapid_framework.generator.Generator.saveNewOutputFileContent
(Generator.java:220)
    at 
cn.org.rapid_framework.generator.Generator.generateNewFileOrInsertIntoFile
(Generator.java:157)
    at 
cn.org.rapid_framework.generator.Generator.generateByModelProvider
(Generator.java:116)
    at 
cn.org.rapid_framework.generator.Generator.generateByModelProvider
(Generator.java:77)
    at cn.org.rapid_framework.generator.GeneratorFacade.generateByTable
(GeneratorFacade.java:44)
    at cn.org.rapid_framework.generator.GeneratorMain.main
(GeneratorMain.java:19)
Exception in thread "main" java.lang.RuntimeException: generate 'Database 
Table:TXN_LOG to ClassName:TxnLog' oucur error,template 
is:java_src\${basepackage_dir}\dao\${className}Dao.java
    at 
cn.org.rapid_framework.generator.Generator.generateByModelProvider
(Generator.java:118)
    at 
cn.org.rapid_framework.generator.Generator.generateByModelProvider
(Generator.java:77)
    at cn.org.rapid_framework.generator.GeneratorFacade.generateByTable
(GeneratorFacade.java:44)
    at cn.org.rapid_framework.generator.GeneratorMain.main
(GeneratorMain.java:19)
Caused by: freemarker.core.InvalidReferenceException: Expression 
table.idColumn is undefined on line 12, column 67 in 
java_src\${basepackage_dir}\dao\${className}Dao.java.
    at freemarker.core.TemplateObject.assertNonNull
(TemplateObject.java:124)
    at freemarker.core.TemplateObject.invalidTypeException
(TemplateObject.java:134)
    at freemarker.core.Dot._getAsTemplateModel(Dot.java:78)
    at freemarker.core.Expression.getAsTemplateModel
(Expression.java:89)
    at freemarker.core.Expression.getStringValue(Expression.java:93)
    at freemarker.core.DollarVariable.accept(DollarVariable.java:76)
    at freemarker.core.Environment.visit(Environment.java:208)
    at freemarker.core.MixedContent.accept(MixedContent.java:92)
    at freemarker.core.Environment.visit(Environment.java:208)
    at freemarker.core.Environment.process(Environment.java:188)
    at freemarker.template.Template.process(Template.java:237)
    at 
cn.org.rapid_framework.generator.Generator.saveNewOutputFileContent
(Generator.java:220)
    at 
cn.org.rapid_framework.generator.Generator.generateNewFileOrInsertIntoFile
(Generator.java:157)
    at 
cn.org.rapid_framework.generator.Generator.generateByModelProvider
(Generator.java:116)
    ... 3 more

Original issue reported on code.google.com by wfu...@gmail.com on 25 Nov 2009 at 9:44

GoogleCodeExporter commented 8 years ago
这个查看FAQs,没有主键导致

Original comment by bad...@gmail.com on 25 Nov 2009 at 9:45

GoogleCodeExporter commented 8 years ago
如何解决?

Original comment by neolf....@gmail.com on 8 Dec 2009 at 2:10

GoogleCodeExporter commented 8 years ago
没提到怎么解决 
没有主键的表就一定是生成出错吗? 

Original comment by cnjoy...@gmail.com on 4 Apr 2010 at 2:54

GoogleCodeExporter commented 8 years ago
报这个错误就是没有主键.

freemarker.core.InvalidReferenceException: Expression table.idColumn is 
undefined on line 12, column 67 in java_src\${basepackage_dir}
\dao\${className}Dao.java.

你自己手工修改模板也可以。 
但是没有主键是生成不了增删改查的。

Original comment by bad...@gmail.com on 6 Apr 2010 at 1:49