注意:
来自官方文档:
If you have multiple implementations registered in the ApplicationContext, you can select the one to be used by explicitly setting the auditorAwareRef attribute of @EnableJpaAuditing.
示例:
@EnableJpaAuditing(auditorAwareRef="auditorProvider")
public class PersistenceConfig {
...
@Bean
AuditorAware<String> auditorProvider() {
return new AuditorAwareImpl();
}
...
}