Hello All,
While trying to load a transient entity , hibernate is throwing an exception.
One of the field of java entity is of type long and the corresponding column in the database is of type NUMBER. If this coloumn in database is not null my code works fine, but if the value of this column is 'NULL' , hibernate throws me an exception , which is shown below:
--------------------------------------------------------------------------------------
net.sf.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.xyx.managed.abc.entity.Testtbl.setEmpNo
-------------------------------------------------------------------------------------
EMPNO column in database is of type NUMBER(10) , it is represented by a long java primitive type in the corresponding java entity. If that particular column is NULL. I get the above exception. Also note that other columns of type VARCHAR2 (represented by String in corresponding java entity) pose no problems when their value is null in the database.
PS: EMPNO is not the primary key for this table.
Any help will be appreciated.
Thanks
|