实体元数据建模时候关于id问题can't find column in table

栏目:s-hr cloud知识作者:金蝶来源:金蝶云社区发布:2024-09-16浏览:1

实体元数据建模时候关于id问题can't find column in table

二开在新建实体元数据时候,实体元数据会自动带出一个id,如果这个实体不继承至CoreBase基类的实体,那么这个id属性就是主键,无需删除;如果继承至CoreBase基类的实体,那么新带的id属性需要手工删除,不然在程序运行时候就会报错;同时逻辑建需要设置为CoreBase的id属性

如:


Caused by: java.lang.reflect.UndeclaredThrowableException: TxEJB wrap a Not_BaseException while Reflect Invoke ControllerBean.
at com.kingdee.bos.transaction.EJBTxFacade.TxInvokerBean.invoke(TxInvokerBean.java:161) ~[sp-bosframework.jar:]
at com.kingdee.bos.transaction.EJBTxFacade.TxInvokerBean.INVOKE_REQUIRED(TxInvokerBean.java:60) ~[sp-bosframework.jar:]
... 199 more
Caused by: java.lang.IllegalStateException: can't find column in table. bo:com.kingdee.eas.hr.custom.performance.configuration.app.AppraisalIdentityRelationHR, prop:id
at com.kingdee.bos.metadata.entity.EntityObjectInfo.innerGetMappingFieldOfProperty(EntityObjectInfo.java:1646) ~[sp-metadata.jar:]
at com.kingdee.bos.metadata.entity.EntityObjectInfo.getMappingFieldOfProperty(EntityObjectInfo.java:1602) ~[sp-metadata.jar:]
at com.kingdee.bos.dao.ormapping.impl.SQLGeneratorImpl.innerGetSQL(SQLGeneratorImpl.java:270) ~[sp-bosframework.jar:]
at com.kingdee.bos.dao.ormapping.impl.SQLGeneratorImpl.innerSelectSQL(SQLGeneratorImpl.java:181) ~[sp-bosframework.jar:]
at com.kingdee.bos.dao.ormapping.impl.SQLGeneratorImpl.selectSQL(SQLGeneratorImpl.java:107) ~[sp-bosframework.jar:]
at com.kingdee.bos.dao.ormapping.impl.SQLGeneratorCache.selectSQL(SQLGeneratorCache.java:111) ~[sp-bosframework.jar:]
at com.kingdee.bos.dao.ormapping.impl.SQLGeneratorCache.selectSQL(SQLGeneratorCache.java:89) ~[sp-bosframework.jar:]
at com.kingdee.bos.dao.ormapping.impl.SQLGeneratorCache.selectSQL(SQLGeneratorCache.java:80) ~[sp-bosframework.jar:]
at com.kingdee.bos.dao.ormapping.impl.EntityAccess.exists(EntityAccess.java:489) ~[sp-bosframework.jar:]
at com.kingdee.bos.dao.ormapping.impl.ObjectReader.exist(ObjectReader.java:281) ~[sp-bosframework.jar:]
at com.kingdee.bos.dao.ormapping.ORMappingDAO.exists(ORMappingDAO.java:1396) ~[sp-bosframework.jar:]
at com.kingdee.bos.framework.ejb.AbstractEntityControllerBean.innerExists(AbstractEntityControllerBean.java:116) ~[sp-bosframework.jar:]
at com.kingdee.eas.framework.app.AbstractCoreBaseControllerBean._exists(AbstractCoreBaseControllerBean.java:606) ~[eas_framework-server.jar:]
at com.kingdee.eas.hr.custom.performance.configuration.app.AbstractAppraisalIdentityRelationHRControllerBean._exists(AbstractAppraisalIdentityRelationHRControllerBean
2023-11-10 13:59:20 信息 [con.out-Thread 309] .java:98) ~[performance.jar:?]
at com.kingdee.eas.hr.custom.performance.configuration.app.AbstractAppraisalIdentityRelationHRControllerBean.exists(AbstractAppraisalIdentityRelationHRControllerBean.java:82) ~[performance.jar:?]
at com.kingdee.shr.base.syssetting.app.BaseItemRelationHRControllerBean.doStateByTwoId(BaseItemRelationHRControllerBean.java:258) ~[sp-shr_syssetting-server.jar:]
at com.kingdee.shr.base.syssetting.app.BaseItemRelationHRControllerBean._enable(BaseItemRelationHRControllerBean.java:131) ~[sp-shr_syssetting-server.jar:]
at com.kingdee.shr.base.syssetting.app.AbstractBaseItemRelationHRControllerBean.enable(AbstractBaseItemRelationHRControllerBean.java:242) ~[sp-shr_syssetting-server.jar:]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_345]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_345]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_345]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_345]
at com.kingdee.bos.transaction.EJBTxFacade.TxInvokerBean.invoke(TxInvokerBean.java:125) ~[sp-bosframework.jar:]
at com.kingdee.bos.transaction.EJBTxFacade.TxInvokerBean.INVOKE_REQUIRED(TxInvokerBean.java:60) ~[sp-bosframework.jar:]
... 199 more

检查实体元数据,发现该实体继成至CoreBase,但是id属性未删除

image.webp

标准产品正确做法如图:

image.webp


实体元数据建模时候关于id问题can't find column in table

二开在新建实体元数据时候,实体元数据会自动带出一个id,如果这个实体不继承至CoreBase基类的实体,那么这个id属性就是主键,无需删除;如...
点击下载文档
确认删除?
回到顶部
客服QQ
  • 客服QQ点击这里给我发消息