java ssh整合问题:hibernate级联删除
我用SSh整合时写delete时出现问题,action如下:publicStringdelete(){Newsnews=newsService.load(newsid);...
我用SSh整合时 写delete时出现问题,action如下:
public String delete(){
News news = newsService.load(newsid);
newsService.delete(news);
return "success";
}
但是提示:org.springframework.orm.hibernate3.HibernateSystemException: a different object with the same identifier value was already associated with the session: [com.blog.model.User#10]; nested exception is org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [com.blog.model.User#10]
怎么解决啊?
我大概知道说的什么意思,但是还是不知道怎么去解决,我用的是 annotation 展开
public String delete(){
News news = newsService.load(newsid);
newsService.delete(news);
return "success";
}
但是提示:org.springframework.orm.hibernate3.HibernateSystemException: a different object with the same identifier value was already associated with the session: [com.blog.model.User#10]; nested exception is org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [com.blog.model.User#10]
怎么解决啊?
我大概知道说的什么意思,但是还是不知道怎么去解决,我用的是 annotation 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询