Caused by: org.hibernate.TypeMismatchException: Provided id of the wrong type. Expected: class java.lang.Integer, got class [Lja
2008-05-22 13:57
573 查看
在作hibernate的删除时使用了方法
com.sitechasia.webx.core.dao.hibernate3.BaseHibernateDomainDao#deleteByIds(java.io.Serializable[])
进行删除时出现了如下怪异的异常:
testDeleteByIds(com.sitechasia.webx.core.dao.hibernate3.BaseHibernateDomainDaoTest)
org.springframework.orm.hibernate3.HibernateSystemException: Provided id of the wrong type. Expected: class java.lang.Integer, got class [Ljava.io.Serializable;; nested exception is org.hibernate.TypeMismatchException: Provided id of the wrong type. Expected: class java.lang.Integer, got class [Ljava.io.Serializable;
Caused by: org.hibernate.TypeMismatchException: Provided id of the wrong type. Expected: class java.lang.Integer, got class [Ljava.io.Serializable;
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:84)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:815)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:808)
at org.springframework.orm.hibernate3.HibernateTemplate$1.doInHib
解决方法如下:
1.首先检查传参类型是否正确.
2.再检查方法是否正确,我就是因为使用了
com.sitechasia.webx.core.dao.hibernate3.BaseHibernateDomainDao#deleteById(java.io.Serializable)
方法而传了一个数组进来
com.sitechasia.webx.core.dao.hibernate3.BaseHibernateDomainDao#deleteByIds(java.io.Serializable[])
进行删除时出现了如下怪异的异常:
testDeleteByIds(com.sitechasia.webx.core.dao.hibernate3.BaseHibernateDomainDaoTest)
org.springframework.orm.hibernate3.HibernateSystemException: Provided id of the wrong type. Expected: class java.lang.Integer, got class [Ljava.io.Serializable;; nested exception is org.hibernate.TypeMismatchException: Provided id of the wrong type. Expected: class java.lang.Integer, got class [Ljava.io.Serializable;
Caused by: org.hibernate.TypeMismatchException: Provided id of the wrong type. Expected: class java.lang.Integer, got class [Ljava.io.Serializable;
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:84)
at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:878)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:815)
at org.hibernate.impl.SessionImpl.get(SessionImpl.java:808)
at org.springframework.orm.hibernate3.HibernateTemplate$1.doInHib
解决方法如下:
1.首先检查传参类型是否正确.
2.再检查方法是否正确,我就是因为使用了
com.sitechasia.webx.core.dao.hibernate3.BaseHibernateDomainDao#deleteById(java.io.Serializable)
方法而传了一个数组进来
相关文章推荐
- Provided id of the wrong type for class pojo.Books. Expected: class java.lang.Integer, got class java.lang.Long
- org.hibernate.TypeMismatchException: Provided id of the wrong type for class
- hibernate 错误:Provided id of the wrong type for class com.lhaix.pojo.Test. Expected: class java.la
- hibernate.TypeMismatchException: Provided id of the wrong type for class
- Exception in thread "main" org.hibernate.TypeMismatchException: Provided id of the wrong type
- SSH报错之 Provided id of the wrong type for class model.User. Expected: class java.lang
- TypeMismatchException: Provided id of the wrong type for class zhongfucheng.user.entity.User.
- TypeMismatchException: Provided id of the wrong type for class zhongfucheng.user.entity.User.
- org.hibernate.WrongClassException: Object with id: 3 was not of the specified subclass
- hibernate 中 Provided id of the wrong type for class 异常
- Caused by: java.lang.ClassCastException: org.hibernate.type.StringType cannot be cast to org.hiberna
- Caused by: java.lang.ClassCastException: org.hibernate.type.StringType cannot be cast to org.hiberna
- Hibernate异常:Provided id of the wrong type for class
- Caused by: java.lang.ClassNotFoundException: org.hibernate.service.jta.platform.spi.JtaPlatform
- Caused by: java.lang.ClassNotFoundException: org.hibernate.annotations.common.reflection.MetadataPro
- Caused by: java.lang.ClassNotFoundException: org.hibernate.service.jta.platform.spi.JtaPlatform
- Caused by: java.lang.ClassNotFoundException: org.hibernate.engine.transaction.spi.TransactionContext
- Caused by: java.lang.ClassNotFoundException: org.hibernate.impl.SessionImpl
- Caused by: java.lang.ClassNotFoundException: org.hibernate.engine.transaction.spi.TransactionContext
- Caused by: java.lang.ClassNotFoundException: org.hibernate.annotations.common.reflection.MetadataPro