Announcement Announcement Module
No announcement yet.
Save and Delete extension points for CrudRepository Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Save and Delete extension points for CrudRepository


    I'm writing a prototype system using Spring Data with Mongo DB. Very much at the playing around with new technology stage at the moment.

    I quite like the amount of code I don't have to write if I extend the CrudRepository interface, and I've read how to extend the functionality should I want to implement (say) a query and not use the @Query annotation.

    However how do I go about augmenting the save function, for example if I want the save method to call setLastUpdated(Date date) just before my object is saved?

    I've not tried anything but am assuming using the method described at
    would not be able to override the save and delete methods in CrudRepository.