@wendal 测试了一下,插入的时候有和唯一索引的话会抛异常然后会让这个线程直接崩掉,有什么办法可以直接一个检测一个对象是否和唯一索引重复
类似于
Dao.check(T obj)
异常信息如下
Exception in thread "Timer-0" org.nutz.dao.DaoException: !Nutz SQL Error: 'INSERT INTO t_timecount(deviceId,countId,date,startTime,countTime) VALUES('9c879c33','activeTime',20161116,1479260866464,70063) '
PreparedStatement:
'INSERT INTO t_timecount(deviceId,countId,date,startTime,countTime) VALUES(?,?,?,?,?) '
CaseMessage=Duplicate entry 'ac00bf13-activeTime-1479215437639' for key 'index_timecount1'
at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:104)
at org.nutz.dao.DaoInterceptorChain.doChain(DaoInterceptorChain.java:66)
at org.nutz.dao.impl.interceptor.DaoLogInterceptor.filter(DaoLogInterceptor.java:22)
at org.nutz.dao.DaoInterceptorChain.doChain(DaoInterce