Been playing around with Hibernate and mapping classes with Java. A reason why Hibernate is useful is so to facilitate users to stop writing pure SQL for queries and reduce code redundancy. A slight note, Hibernate also works well with the .NET platform.
Though there was this error which TechieDan experienced
org.springframework.orm.hibernate3.HibernateSystemException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.tm.ccpm.biz.domain.product.ProductSubCategory.setIdelivery;
Surprisingly the mistake wasn’t software based. After looking through Hibernate.org websites and other sites for help, it was because of a simple mistake. While creating the field of IDELIVERY into the table, the default value was null, and considering that the IDELIVERY column is integer, it should be defaulted to a default value. So since the column was created earlier with a null value, all that was needed to be done is to update the data in the table to repair this error.
Here’s what I did and it finally is running once again.
update TABLENAME set IDELIVERY = 0;
addthis_url = 'http%3A%2F%2Ftechiedan.com%2F2009%2F12%2F17%2Fhibernate-error-exception-setting-property-value%2F';
addthis_title = 'Hibernate+Error+%3A+exception+setting+property+value';
addthis_pub = 'danielctw';