Skip to content

Commit

Permalink
Reuse id object
Browse files Browse the repository at this point in the history
  • Loading branch information
cgendreau committed Oct 8, 2024
1 parent f522029 commit 6363a85
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ private QuerySpec resolveFilterAdapters(QuerySpec querySpec) {
*/
@Transactional
@Override
@SuppressWarnings("unchecked")
public <S extends D> S save(S resource) {

// make sure data is safe to manipulate
Expand All @@ -323,9 +324,7 @@ public <S extends D> S save(S resource) {
dinaService.update(entity);

// reload since the data may be changed by the service
D dto = findOne(
(Serializable) PropertyUtils.getProperty(entity, idFieldName),
new QuerySpec(resourceClass));
D dto = findOne((Serializable) id, new QuerySpec(resourceClass));

auditService.ifPresent(service -> service.audit(dto));
return (S) dto;
Expand Down

0 comments on commit 6363a85

Please sign in to comment.