问题描述:Null value was assigned to a property of primitive type setter ,hibernate short型数据无法读取 hiberante读short 整型数据出错 hiberante读数据库出错
Caused by: org.springframework.orm.hibernate3.HibernateSystemException: Null value was assigned to a property of primitive type setter of com.running.crm.model.MoSms.tpPid;
nested exception is org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of com.running.crm.model.MoSms.tpPid
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:658)
at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:377)
at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:840)
at com.running.dao.impl.GenericDaoImplHibernate.find(GenericDaoImplHibernate.java:95)
at sun.reflect.GeneratedMethodAccessor442.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy21.find(Unknown Source)
at com.running.crm.web.controller.MoSmsController.list(MoSmsController.java:103)
... 42 more
原因:数据库字段值为NULL,short 类型不能赋值为NULL,只能为0;