Spring-Date JPA and Audit with update by @Modifying

1

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?

    
asked by anonymous 19.01.2016 / 22:25

1 answer

2

@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 .

    
20.01.2016 / 16:45