实体类
@Table("pojo")
public class Pojo {
@Name
@Prev(els = @EL("uuid()"))
@ColDefine(width = 32)
private String uuid;
@Column
private int userid;
@Column
@ColDefine(width = 50)
private String keySn;
@Column
@Comment("创建时间")
private Timestamp ct;
//略 set get
}
Pojo pojo= dao.fetch(Pojo.class, Cnd.where("userid", "=", userid));
if (pojo== null) {
pojo= new Pojo();
}
pojo.setCt(new Timestamp(System.currentTimeMillis()));
pojo.setKeySn(SN);
pojo.setUserid(userid);
dao.insertOrUpdate(pojo);
org.nutz.dao.DaoException: java.lang.RuntimeException: r u kidding me?! It is impossible!
at org.nutz.dao.impl.sql.run.NutDaoRunner._runWithoutTransaction(NutDaoRunner.java:139)
at org.nutz.dao.impl.sql.run.NutDaoRunner._run(NutDaoRunner.java:92)
at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:81)
at org.nutz.dao.impl.DaoSupport.run(DaoSupport.java:240)
at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:252)
at org.nutz.dao.impl.NutDao.fetch(NutDao.java:616)
at org.nutz.dao.impl.NutDao.insertOrUpdate(NutDao.java:1069)
at org.nutz.dao.impl.NutDao.insertOrUpdate(NutDao.java:1063)