Joined: Fri Aug 02, 2013 8:24 am Posts: 9
|
Hello,
I am getting class cast exception "java.lang.Integer cannot be cast to java.math.BigDecimal". I had my application running on Hibernate - SQL server combination. I am currently migrating it to Oracle.
I regenerated all the HBM file. and now running application I get following error.
java.lang.Integer cannot be cast to java.math.BigDecimal java.lang.ClassCastException: java.lang.Integer cannot be cast to java.math.BigDecimal at org.hibernate.type.BigDecimalType.isEqual(BigDecimalType.java:44) at org.hibernate.type.NullableType.isEqual(NullableType.java:160) at org.hibernate.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:57) at org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:157) at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:113) at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:196) at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76) at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:35) at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:969) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1562) at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283) at org.springframework.orm.hibernate3.HibernateTemplate$36.doInHibernate(HibernateTemplate.java:1056) at org.springframework.orm.hibernate3.HibernateTemplate$36.doInHibernate(HibernateTemplate.java:1) at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406) at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374) at org.springframework.orm.hibernate3.HibernateTemplate.findByCriteria(HibernateTemplate.java:1046) at org.springframework.orm.hibernate3.HibernateTemplate.findByCriteria(HibernateTemplate.java:1039) at com.dao.impl.PersistenceManagerHibernateImpl.findByDetachedCriteria(PersistenceManagerHibernateImpl.java:163)
I all POJO classes generated along with HBM files have BigDecimal as data type for primary key. While passing criteria for "findByDetachedCriteria" method I am passing two criteria. one is String and another one is instance of POJO class which again has primary key as BigDecimal. I am not at all passing any integer value.
Can anyone please guide me on this?
|
|