was altered from xxx to null; nested exception is org.hibernate.HibernateException
was altered from xxxto null; nested exception is org.hibernate.HibernateException直接上干货:在使用JPA时 如果使用的保存方法在保存数据库已存在的对象时,而这时你将数据库的已存在的数据传过来并使其主键id为null 这时如果调用JPA的修改方法就出出现这个错误 .解决办法 在一个事务中当使其主键id为null调用JPA自带的save方法而不是update方法...
原创
2021-11-05 09:32:54 ·
2950 阅读 ·
1 评论