主题:主键未发现,检查数据库表定义或者NameConversion

jsdjiazhiheng 2018年10月29日 60

写了一个定时任务,然后定时查询数据,将其插入另外一个库内后,再修改本库对应数据的状态,现在将数据插入另外一个库后,再修改对应数据状态时,抛出以下异常,调用更新方法为

sqlManager.updateBatchTemplateById(classzz, List) 方法

image.png

对应实体类为

@Table(name = "pxcsatisfactionappraise1")
public class PXCSATISFACTIONAPPRAISE1 {

	@SeqID(name="SEQ_KPB_FWPJ_APPRAISE_FULL")
	private Long SASSATISFACTIONAPPRAISEID;
	private String SASACCEPTEDEMP;
	private String SASACCEPTEDNO;
	private String SASACCEPTEDWINDOW;
	private String SASAPPLYUNIT;
	private String SASCHILDUNITNAME;
	private String SASCONTACTPHONE;
	private String SASDATASIGN;
	private String SASEVALUATIONRESULT;
	private String SASFULLNAME;
	private String SASIMPORTUSER;
	private String SASMATTERNAME;
	private String SASMATTERNO;
	private String SASMATTERTYPE;
	private Long SASREMOTESYN;
	private String SASSATISAPPUUID;
	private Long SASTIMEDIFFERENCE;
	private String SASUNITCODE;
	private String SASUNITNAME;
	private String SASUNITYNUB;
	private Date SASACCEPTEDTIME;
	private Date SASCREATETIME;
	private Date SASEVALUATIONTIME;
	private Date SASFINISHTIME;
	private Date SASIMPORTTIME;
	private Date SASUPLOADTIME;

}

实体类已经设置了ID注解

错误异常信息为

2018-10-29 15:38:38.719  INFO 14560 --- [pool-1-thread-1] com.hxkj.demo.task.FwpjTask              : -----------进入方法--------
	at org.beetl.sql.core.db.AbstractDBStyle.checkId(AbstractDBStyle.java:827)
	at org.beetl.sql.core.db.AbstractDBStyle.appendIdCondition(AbstractDBStyle.java:731)
	at org.beetl.sql.core.db.AbstractDBStyle.genUpdateTemplate(AbstractDBStyle.java:297)
	at org.beetl.sql.core.SQLManager.getScript(SQLManager.java:394)
	at org.beetl.sql.core.SQLManager.updateBatchTemplateById(SQLManager.java:1383)
	at com.hxkj.demo.task.FwpjTask.saveFwpjData(FwpjTask.java:64)
	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.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84)
	at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
jsdjiazhiheng 2018年10月29日

问题已经解决了,首先数据库里居然没有创建主键(ORACLE),然后在 创建主键后重新生成了一下md文件和实体类后就可以了

闲大赋 2018年10月29日

好的,谢谢回答