I have encountered this issue!
Luckily, I determine 2 ways and understand some things but the rest is not clear.
Hope someone discuss or support if you know.
- Use RepositoryExtendJPA.save(entity).
Example:
List<Person> person = this.PersonRepository.findById(0)
person.setName("Neo");
This.PersonReository.save(person);
this block code updated new name for record which has id = 0;
- Use @Transactional from javax or spring framework.
Let put @Transactional upon your class or specified function, both are ok.
I read at somewhere that this annotation do a "commit" action at the end your function flow. So, every things you modified at entity would be updated to database.