org.springframework.orm.hibernate3.HibernateSystemException: ... why it was?
Hi i am using Spring-Hibernate with HibernateDaoSupport
, where my Dao was extends by HibernateDaoSupport
. when i am getting the data from table the following error was raising, when i am submitting the data on same table it running successfuly.. can any one give your idea?
Error:
org.springfram开发者_运维百科ework.orm.hibernate3.HibernateSystemException: Null value was assigned to a property of primitive type setter of com.mypack.table.TblValues.minval; nested exception is org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of com.mypack.table.TblValues.minval
Note: minval
is the one of the column in table TblValues
, and i assigning null value.
code in table pojo for getter & setter property:
@Column(name="minVal",nullable=true)
public byte getMinVal() {
return this.minVal;
}
public void setMinVal(byte minVal) {
this.minVal = minVal;
}
You can't have a nullable
primitive type, that's a contradiction (in Java, at least).
If you want minVal
to be nullable, you need to use the Byte
java type, not byte
.
精彩评论