sampathkumarpb wrote:
I have legacy pojo object which has some primitive attributes and its been mapped to table...
When we load the object with null value being returned for the primitive type by the database....hibernate throws the following exception.
com.fmrco.gett.refdata.util.RefDataException: Error in retrieving the Command data = org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of com.fmrco.gett.refdata.entity.command.Parameter.parameterPosition
at com.fmrco.gett.refdata.dao.impl.HibernateCommandDAO.findAllCommands(HibernateCommandDAO.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
Use object types to create fields of your persistent entities (except marked by @Transient). It's more safety and efficient after all.