修改持久性JPA对象

时间:2018-11-25 16:35:12

标签: spring-boot jpa spring-data-jpa

我有一个详细的实体学生,我如何允许更新现有数据并跟踪对该对象所做的更改?

Student oldStudent = new Student()
oldStudent.getStudent(id);
Copy contents of old student, and save them on an amendment entity
Then update the oldstudent and save it as the new referenced entity.

我们将非常感谢您使用jpa进行操作。

1 个答案:

答案 0 :(得分:0)

可以使用apache库进行复制: http://commons.apache.org/proper/commons-beanutils/

-v /var/run/docker.sock:/var/run/docker.sock

这会将所有字段从当前对象复制到更新对象。