`
IThead
  • 浏览: 426867 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

org.springframework.orm.hibernate3.HibernateSystemException: identifier of

阅读更多
异常如下:
Exception in thread "main" org.springframework.orm.hibernate3.HibernateSystemException: identifier of an instance of com.tarena.entity.User was altered from 1 to 1; nested exception is org.hibernate.HibernateException: identifier of an instance of com.tarena.entity.User was altered from 1 to 1
Caused by: org.hibernate.HibernateException: identifier of an instance of com.zhssh.vo.TUser was altered from 1 to 1
at org.hibernate.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:51)
at org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:150)
at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:106)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:195)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:985)
at org.springframework.orm.hibernate3.HibernateAccessor.flushIfNecessary(HibernateAccessor.java:390)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:373)
at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:840)
at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:832)
at com.zhssh.spring.dao.TUserDAO.findAll(TUserDAO.java:113)
at com.zhssh.spring.dao.test.TUserDAOTest.main(TUserDAOTest.java:25)

原因:hbm里面id的type和java文件里面的不一样!
0
2
分享到:
评论

相关推荐

    org.springframework.orm.hibernate3.LocalSessionFactoryBean

    ### 关于 "org.springframework.orm.hibernate3.LocalSessionFactoryBean" 未找到问题的知识点解析 #### 一、问题背景 在开发基于Spring与Hibernate整合的应用时,可能会遇到“`org.springframework.orm.hibernate...

    org.springframework.orm.hibernate4.HibernateOptimisticLockingFailureException

    标题中的"org.springframework.orm.hibernate4.HibernateOptimisticLockingFailureException"是一个具体的异常类型,源自Spring框架的Hibernate4模块。这个异常通常在乐观锁(Optimistic Locking)机制失败时抛出,...

    org.spring-framework-3.0.4. 所有jar

    org.springframework.orm-3.0.4.RELEASE.jar org.springframework.oxm-3.0.4.RELEASE.jar org.springframework.spring-library-3.0.4.RELEASE.libd org.springframework.test-3.0.4.RELEASE.jar org.spring...

    org.springframework.orm-3.0.0.M1.jar

    org.springframework.orm-3.0.0.M1.jar

    spring3.0.5 所有jar文件

    org.springframework.orm-3.0.5.RELEASE.jar org.springframework.oxm-3.0.5.RELEASE.jar org.springframework.test-3.0.5.RELEASE.jar org.springframework.transaction-3.0.5.RELEASE.jar org.springframework.web...

    spring3.1 官方全部jar包

    org.springframework.orm-3.1.RELEASE.jar org.springframework.oxm-3.1.RELEASE.jar org.springframework.spring-library-3.1.RELEASE.libd org.springframework.test-3.1.RELEASE.jar org.springframework....

    hibernate错误解决方案

    org.springframework.orm.ObjectRetrievalFailureException: Object of class [com.xindeco.myregister.pojo.MyRegisterInfo] with identifier [14]: not found ``` 这表示尝试获取 `MyRegisterInfo` 类型的对象,但...

    org.springframework.orm.jar.zip

    其中,`org.springframework.orm.jar`是Spring框架中的一个子模块,主要关注对象关系映射(ORM)集成,使得Java应用程序能够方便地与各种数据库进行交互。本文将深入探讨Spring ORM模块的核心概念、功能以及实际应用...

    spring3.1.1jar及其关联jar

    org.springframework.orm-3.1.1.RELEASE org.springframework.oxm-3.1.1.RELEASE org.springframework.test-3.1.1.RELEASE org.springframework.transaction-3.1.1.RELEASE org.springframework.web.portlet-3.1.1....

    org.springframework.orm-3.1.0.M2

    org.springframework.orm-3.1.0.M2

    org.springframework.beans-3.0.0.M4.jar

    org.springframework.beans-3.0.0.M4.jar

    Spring所需jar包

    org.springframework.orm-3.0.0.RELEASE.jar org.springframework.oxm-3.0.0.RELEASE.jar org.springframework.test-3.0.0.RELEASE.jar org.springframework.transaction-3.0.0.RELEASE.jar org.springframework.web...

    org.springframework.orm-3.0.0.M4.jar

    org.springframework.orm-3.0.0.M4.jar

    org.springframework.dao.InvalidDataAccessApiUsageException

    <bean id="transactionManager" class="org.springframework.orm.hibernate5.HibernateTransactionManager"> ``` 2. **使用 `@Transactional` 注解**: 在Service层或具体的业务逻辑方法上添加 `@...

    解决SpringDataJPA报错:org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null w

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/...

    spring-framework-3.0.0.M4-with-docs

    org.springframework.orm-3.0.0.M4.jar: 整合第三方的ORM框架,如hibernate,ibatis,jdo,以及spring的JPA实现 org.springframework.transaction-3.0.0.M4.jar: 为JDBC、Hibernate、JDO、JPA等提供的一致的声明式和...

    spring3.0.0相关jar包

    org.springframework.orm-3.0.0.RELEASE org.springframework.oxm-3.0.0.RELEASE org.springframework.spring-library-3.0.0.RELEASE org.springframework.test-3.0.0.RELEASE org.springframework.transaction-...

    Spring高版本对ibatis的支持

    <bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean"> <value>classpath:SqlMapConfig.xml <bean id="dao" class="org.springframework.orm.ibatis....

    spring mvc 3.0.5工程所需包整合

    org.springframework.instrument-3.0.5.RELEASE.jar,org.springframework.jdbc-3.0.5.RELEASE.jar,org.springframework.jms-3.0.5.RELEASE.jar,org.springframework.orm-3.0.5.RELEASE.jar,org.springframework....

    SpringMVC开发jar包

    org.springframework.orm-3.1.0.RELEASE.jar org.springframework.oxm-3.1.0.RELEASE.jar org.springframework.test-3.1.0.RELEASE.jar org.springframework.transaction-3.1.0.RELEASE.jar org.springframework.web...

Global site tag (gtag.js) - Google Analytics