NutzCN Logo
问答 org.nutz.dao.DaoException:
发布于 2377天前 作者 wx_nvu0j53rdpc0ebqbi0kc 1625 次浏览 复制 上一个帖子 下一个帖子
标签:
org.nutz.dao.DaoException: Field(private java.lang.String com.wonders.biz.fl.fljg.xmgl.ssxm.entity.DfjgQuotaAllotDO.id) annotation @Id , but not Number type!!
	at org.nutz.dao.DaoException$FC$ab706b0cf40b3b24094a0af312e173b9.invoke(DaoException.java)
	at org.nutz.lang.born.AbstractConstructorBorning.call(AbstractConstructorBorning.java:25)
	at org.nutz.lang.born.ConstructorBorning.born(ConstructorBorning.java:19)
	at org.nutz.lang.born.BornContext.doBorn(BornContext.java:60)
	at org.nutz.lang.Mirror.born(Mirror.java:990)
	at org.nutz.lang.Lang.makeThrow(Lang.java:152)
	at org.nutz.dao.impl.entity.info._Infos.createMappingInfo(_Infos.java:134)
	at org.nutz.dao.impl.entity.AnnotationEntityMaker.make(AnnotationEntityMaker.java:185)
	at org.nutz.dao.impl.EntityHolder.getEntity(EntityHolder.java:72)
	at org.nutz.dao.impl.EntityHolder.getEntityBy(EntityHolder.java:109)
	at org.nutz.dao.impl.NutDao._optBy(NutDao.java:970)
	at org.nutz.dao.impl.NutDao.insert(NutDao.java:131)
	at com.wonders.biz.fl.fljg.xmgl.ssxm.manage.SsProjectManage.saveIssuedDefine(SsProjectManage.java:103)
	at com.wonders.biz.fl.fljg.xmgl.ssxm.manage.SsProjectManage$$NUTZAOP._aop_invoke(SsProjectManage.java:1)
	at org.nutz.aop.InterceptorChain.invoke(InterceptorChain.java:77)
	at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:57)
	at org.nutz.aop.interceptor.TransactionInterceptor.filter(TransactionInterceptor.java:34)
	at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:60)
	at com.wonders.framework.common.interceptor.LoggerInterceptor.filter(LoggerInterceptor.java:40)
	at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:60)
	at com.wonders.biz.fl.fljg.xmgl.ssxm.manage.SsProjectManage$$NUTZAOP.saveIssuedDefine(SsProjectManage.java:1)
	at com.wonders.biz.fl.fljg.xmgl.ssxm.at.SsProjectAt.saveIssuedDefine(SsProjectAt.java:58)
	at com.wonders.biz.fl.fljg.xmgl.ssxm.at.SsProjectAt$$NUTZAOP._aop_invoke(SsProjectAt.java:1)
	at org.nutz.aop.InterceptorChain.invoke(InterceptorChain.java:77)
	at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:57)
	at com.wonders.framework.common.interceptor.LoggerInterceptor.filter(LoggerInterceptor.java:40)
	at org.nutz.aop.InterceptorChain.doChain(InterceptorChain.java:60)
	at com.wonders.biz.fl.fljg.xmgl.ssxm.at.SsProjectAt$$NUTZAOP.saveIssuedDefine(SsProjectAt.java:1)
	at com.wonders.biz.fl.fljg.xmgl.ssxm.at.SsProjectAt$FM$saveIssuedDefine$9114718610540602c267d30c66c5590b.invoke(SsProjectAt.java)
	at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:31)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:33)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
	at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
	at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44)
	at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
	at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
	at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:202)
	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:123)
	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:198)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
	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:803)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1468)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)
@Table("DFJG_QUOTA_ALLOT")
public class DfjgQuotaAllotDO {
    @Id
    @Column("ID")
    private String id;//主键ID
    @Column("QUOTA_ID")
    private String quotaId;//总指标代码,外键到DFJG_PROJECT_QUOTA
    @Column("BSHX0002")
    private String quotaName;//指标名称
    @Column("BSHA0003")
    private String region; //区划代码,外键到DC_REGION.ID
    @Column("BSHX0042")
    private String year;//年度
    @Column("BSHX0004")
    private Number quotaNum;//指标数目
    @Column("IS_VALID")
    private String isValid;//1为有效0为无效
    @Column("CREATE_DATE")
    private Date createDate;//创建时间
    @Column("CREATE_USER_ID")
    private String createUserId;//创建人
    @Column("UPDATE_TIME")
    private Date updateTime;//修改时间
    @Column("UPDATE_USER_ID")
    private String updateUserId;//修改人

 public String saveIssuedDefine(DfjgQutotaAllotVO dfjgQutotaAllotVO){
        DfjgQuotaAllotDO dfjgQuotaAllotDO = new DfjgQuotaAllotDO();
        dfjgQutotaAllotVO.setQuotaNum(Integer.parseInt(dfjgQutotaAllotVO.getQuotaNumS()));
        try {
            BeanUtils.copyProperties(dfjgQuotaAllotDO,dfjgQutotaAllotVO);
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            e.printStackTrace();
        }
        dfjgQuotaAllotDO = dao.insert(dfjgQuotaAllotDO);//这里报错
        mongoDBService.insert(dfjgQuotaAllotDO);
        return "success";
    }
3 回复

为啥会报错啊,这个错报的什么意思?求问 新手

@Id是数值主键,@Name才是字符串主键

想到这个原因了 改了没起作用 今天来了 发现idea没重启(难受),感谢

添加回复
请先登陆
回到顶部