svanders38@gmail.com
Aug 20th, 2011, 09:22 PM
Hi
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 http://static.springsource.org/spring-data/data-document/docs/current/reference/html/#repositories.custom-behaviour-for-all-repositories
would not be able to override the save and delete methods in 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 http://static.springsource.org/spring-data/data-document/docs/current/reference/html/#repositories.custom-behaviour-for-all-repositories
would not be able to override the save and delete methods in CrudRepository.