3.7.5新模板bug
生成实体类出错这是生成的实体类。3.7.5一对多生成。老版本正常
#segment#MonyEntity.java
package com.jeecg.dsafd.entity;
import java.math.BigDecimal;
import java.util.Date;
import java.lang.String;
import java.lang.Double;
import java.lang.Integer;
import java.math.BigDecimal;
import javax.xml.soap.Text;
import java.sql.Blob;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.SequenceGenerator;
import org.jeecgframework.poi.excel.annotation.Excel;
/**
* @Title: Entity
* @Description: testonetomany
* @author onlineGenerator
* @date 2018-05-19 03:34:43
* @version V1.0
*
*/
@Entity
@Table(name = "mony", schema = "")
Expression subsG['${key}'].cgformConfig is undefined on line 33, column 6 in table/onetomany/java/subEntity.ftl.
The problematic instruction:
----------
==> if subsG['${key}'].cgformConfig.cgFormHead.jformPkType?if_exists?html == "SEQUENCE"
in include "/table/onetomany/java/subEntity.ftl" Entity.java]
----------
Java backtrace for programmers:
----------
freemarker.core.InvalidReferenceException: Expression subsG['${key}'].cgformConfig is undefined on line 33, column 6 in table/onetomany/java/subEntity.ftl.
at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:125)
at freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:135)
at freemarker.core.Dot._getAsTemplateModel(Dot.java:78)
at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
at freemarker.core.Dot._getAsTemplateModel(Dot.java:74)
at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
at freemarker.core.BuiltIn$if_existsBI._getAsTemplateModel(BuiltIn.java:751)
at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
at freemarker.core.Expression.getStringValue(Expression.java:93)
at freemarker.core.StringBuiltins$StringBuiltIn._getAsTemplateModel(StringBuiltins.java:71)
at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
at freemarker.core.ComparisonExpression.isTrue(ComparisonExpression.java:111)
at freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:77)
at freemarker.core.Environment.visit(Environment.java:221)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:221)
at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:179)
at freemarker.core.Environment.visit(Environment.java:428)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:102)
at freemarker.core.Environment.visit(Environment.java:221)
at freemarker.core.Environment.include(Environment.java:1508)
at freemarker.core.Include.accept(Include.java:169)
at freemarker.core.Environment.visit(Environment.java:221)
at freemarker.core.Environment.process(Environment.java:199)
at freemarker.template.Template.process(Template.java:259)
at org.jeecgframework.codegenerate.extcommon.FreemarkerHelper.processTemplate(FreemarkerHelper.java:79)
at org.jeecgframework.codegenerate.extcommon.BaseCodeExtCommonFactory.generateNewFileOrInsertIntoFile(BaseCodeExtCommonFactory.java:161)
at org.jeecgframework.codegenerate.extcommon.BaseCodeExtCommonFactory.executeGenerate(BaseCodeExtCommonFactory.java:92)
at org.jeecgframework.codegenerate.extcommon.BaseCodeExtCommonFactory.scanTemplatesAndProcess(BaseCodeExtCommonFactory.java:73)
at org.jeecgframework.codegenerate.extcommon.BaseCodeExtCommonFactory.generateFileCommon(BaseCodeExtCommonFactory.java:56)
at org.jeecgframework.codegenerate.extcommon.onetomany.CgformCodeOne2ManyExtCommonFactory.generateFileCommon(CgformCodeOne2ManyExtCommonFactory.java:32)
at org.jeecgframework.codegenerate.extcommon.onetomany.CgformCodeOne2ManyExtCommonFactory.invokeCommon(CgformCodeOne2ManyExtCommonFactory.java:73)
at org.jeecgframework.codegenerate.extcommon.onetomany.CgformCodeOne2ManyExtCommonGenerate.generateToFile(CgformCodeOne2ManyExtCommonGenerate.java:242)
at org.jeecgframework.web.cgform.controller.generate.GenerateController.dogenerateOne2Many(GenerateController.java:353)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:747)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:676)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:863)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.jeecgframework.core.aop.GZipFilter.doFilter(GZipFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:140)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.orm.hibernate4.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:150)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:625)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:498)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:796)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1372)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
你怎么配置的,有什么特殊的?
主键是什么规则 admin 发表于 2018-5-19 11:27 static/image/common/back.gif
你怎么配置的,有什么特殊的?
主键是什么规则
没任何特殊。我测试都是默认规则。字段任意简单名称 用的是那套模板,你的3.7.5下载时间? admin 发表于 2018-5-19 15:56 static/image/common/back.gif
用的是那套模板,你的3.7.5下载时间?
用的是新版。即昨日修复无法生成文件bug后的代码。github上的版本 admin 发表于 2018-5-19 15:56 static/image/common/back.gif
用的是那套模板,你的3.7.5下载时间?
使用beta版本依旧有此问题 本帖最后由 jeecg_ty 于 2018-5-21 19:38 编辑
一般情况不会出现这个bug,如果有这个bug,请去src/main/resources/jeecg/ext-common-template/table/onetomany/java/subEntity.ftl这个文件下把subsG['${key}'].cgformConfig全部替换成subsG['${key}']经jeecg6群的热心网友【懒洋洋】测试过,非常管用。
jeecg_ty 发表于 2018-5-21 19:33 static/image/common/back.gif
一般情况不会出现这个bug,如果有这个bug,请去src/main/resources/jeecg/ext-common-template/table/oneto ...
他也是闲的蛋疼我从来不这么搞
页:
[1]