4

I have a java class that has a modifiedDate field which is annotated by @LastModifiedDate .

In a particular case , I want to set the field of the "modifiedDate" manually , using the corresponding setter of that field before saving it into a mongo collection (using the org.springframework.data.repository.CrudRepository#save(java.lang.Object) )

I tried it by setting it using the corresponding setter but it did not work. I cannot further remove this annotation as in all other cases , this annotation is extremely helpful.

Note : Please refer : http://ufasoli.blogspot.in/2017/01/spring-data-force-version-and.html . Here , using auditingHandler they are marking an object as modified even though it is not. I want it to be marked unmodified even if it is.

Echo
  • 570
  • 1
  • 7
  • 21

0 Answers0