Repository should only use 'save' method
amatosg opened this issue · comments
Overview of the feature request
I'm not sure if this is a bug or a feature request, so I'm leaving it as FR.
I think using mergeAndSave
method in repositories should be avoided.
Motivation for or Use Case
According to the documentation, in order to either create or update an entity, the method save
should be used.
Related issues or PR
None that I know of.
When no service is generated for entity, I'm not sure because of the @Transactional
annotation on the mergeAndSave
method.
But when entity is generated with serviceClass or serviceImpl we should definitely not generate and use this mergeAndSave
: the transaction is handled at the service level.