Is it possible to audit an update operation with Spring-Data Auditing using the update via @Query
and @Modifying
annotations instead of using the save()
method?
Is it possible to audit an update operation with Spring-Data Auditing using the update via @Query
and @Modifying
annotations instead of using the save()
method?
@Query
and @Modifying
is not related to Auditing. They are annotations that inform Spring Data when a method is just a query, or when this method makes modifications like insert or update.
To work with Spring audit, use AspectJ to intercept what you want to audit. With this api, you can use annotations like @Before
, @After
, @AfterReturning
, @Around
to fulfill what you need. More information on how to do this can be found here more detailed information can be found in the spring reference .