I'm using annotation based configuration.
@Configuration
@Profile("default")
@ComponentScan(basePackages = "com.*")
@EnableMongoRepositories
@EnableMongoAuditing
public class ApplicationDataConfig ....
And I also have @LastModifiedDate
, @CreatedDate
annotation set on fields of type org.joda.time.DateTime
. When I use
org.springframework.data.mongodb.repository.MongoRepository.save(entity)
both the audit fields are updated just fine. But when I use
org.springframework.data.mongodb.core.MongoTemplate.updateFirst()/updateMulti()
the lastupdated time is not being updated. Does anybody have a clue of what could be wrong? I'm using spring-data-mongodb1.8.3