代码:
Bean entity = new Bean();
FieldFilter filter = FieldFilter.create(clazz, true);
entity = dao.insert(entity,filter);
异常信息
org.nutz.dao.DaoException: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'type' cannot be null
at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:54) ~[nutz-1.r.54.jar:na]
at org.nutz.dao.impl.DaoSupport.run(DaoSupport.java:202) ~[nutz-1.r.54.jar:na]
at org.nutz.dao.impl.DaoSupport$DaoExec.run(DaoSupport.java:269) ~[nutz-1.r.54.jar:na]
at org.nutz.trans.Trans.exec(Trans.java:174) ~[nutz-1.r.54.jar:na]
at org.nutz.trans.Trans.exec(Trans.java:132) ~[nutz-1.r.54.jar:na]
at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:239) ~[nutz-1.r.54.jar:na]
at org.nutz.dao.impl.EntityOperator.exec(EntityOperator.java:50) ~[nutz-1.r.54.jar:na]
at org.nutz.dao.impl.NutDao.insert(NutDao.java:144) ~[nutz-1.r.54.jar:na]
at org.nutz.dao.impl.NutDao$2.run(NutDao.java:153) ~[nutz-1.r.54.jar:na]
at org.nutz.dao.FieldFilter.run(FieldFilter.java:285) ~[nutz-1.r.54.jar:na]
at org.nutz.dao.impl.NutDao.insert(NutDao.java:151) ~[nutz-1.r.54.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_80]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.7.0_80]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.7.0_80]
at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.7.0_80]
at org.nutz.dao.util.ExtDaoInvocationHandler$1.run(Daos.java:929) ~[nutz-1.r.54.jar:na]
at org.nutz.dao.FieldFilter.run(FieldFilter.java:285) ~[nutz-1.r.54.jar:na]
at org.nutz.dao.util.ExtDaoInvocationHandler.invoke(Daos.java:951) ~[nutz-1.r.54.jar:na]
at com.sun.proxy.$Proxy27.insert(Unknown Source) ~[na:na]
CREATE TABLE `bean` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`type` bigint(20) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10000005 DEFAULT CHARSET=utf8;