nutz自动建的表,插入数据的时候报错
com.mysql.jdbc.MysqlDataTruncation: Data truncation: Out of range value for column 'total' at row 1
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3968)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3906)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2524)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2677)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2549)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861)
at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1192)
at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:493)
at org.nutz.dao.impl.sql.run.NutDaoExecutor._runPreparedStatement(NutDaoExecutor.java:308)
at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:90)
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(DaoInterceptorChain.java:64)
at org.nutz.dao.DaoInterceptorChain.invoke(DaoInterceptorChain.java:139)
at org.nutz.dao.impl.sql.run.NutDaoRunner.runCallback(NutDaoRunner.java:158)
at org.nutz.dao.impl.sql.run.NutDaoRunner._runWithoutTransaction(NutDaoRunner.java:125)
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.EntityOperator.exec(EntityOperator.java:55)
at org.nutz.dao.impl.NutDao.insert(NutDao.java:148)
at com.qcjy.kotya.service.ManuscriptService.addManuscript(ManuscriptService.java:49)
at com.qcjy.kotya.module.ManuscriptModule.addManuscript(ManuscriptModule.java:79)
at com.qcjy.kotya.module.ManuscriptModule$FM$addManuscript$f469a1796036a6cd03d77b6003c3309a.invoke(ManuscriptModule.java)
manuscript.setPrice((double)Math.round(manuscript.getPrice()*100)/100);
if(manuscript.getTotal()==null) {
Double total=(int)manuscript.getQuantity()*((double)manuscript.getPrice());
manuscript.setTotal(total);
}
前台传过的是5445*54,算出来30W不到,怎么会Out of range啊
@Column
private Integer quantity;
@Column
private Double price;
@Column
private Double total;