Saturday, December 28, 2013

Exception in thread "main" org.hibernate.TypeMismatchException: Provided id of the wrong type for class com.ranga.pojo.Order. Expected: class java.lang.Long, got class java.lang.Integer


Exception in thread "main" org.hibernate.TypeMismatchException: Provided id of the wrong type for class com.ranga.pojo.Order. Expected: class java.lang.Long, got class java.lang.Integer

Problem: 
While passing primary key value in either load() or get() or byId() the value you passed is integer. but it expecting long value.

Solution: 
You need to pass the long value instead of integer.

0 comments: