a different object with the same identifier value was already associated with the session:

项目是ssh注解,用了网上几种方法都无效

最后使用以下代码可以

public void m_save(T o) throws AuthException {
        Session session = this.getCurrentSession();
        session.clear();
        this.getCurrentSession().merge(o);
        session.flush();
    }

猜你喜欢

转载自blog.csdn.net/u012934723/article/details/81183191
今日推荐