报错 no row with the given identifier exists: //could not load an entity:
类似于:
严重: No row with the given identifier exists: [com.twitter.entity.TwitterTopicImage#0]; nested exception is org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.twitter.entity.TwitterTopicImage#0]org.springframework.orm.hibernate3.HibernateObjectRetrievalFailureException: No row with the given identifier exists: [com.twitter.entity.TwitterTopicImage#0]; nested exception is org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.twitter.entity.TwitterTopicImage#0]
?
是关联问题??也就是是说关系数据库一致性遭到了破坏,找到相关表,就可以解决了?? 比如说
有两张表,topic和topicImage.产生此问题的原因就是topic里做了关联<one-to-one>或者<many-to-one unique="true">(特殊的多对一映射,实际就是一对一)来关联topicImage.当hibernate查找的时候,topicImage里的数据没有与topic相匹配的,这样就会报No row with the given identifier exists这个错.(一句话,就是数据的问题!)