注意:
来自官方文档:
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();
}
...
}
本文介绍如何在Spring Boot项目中使用@EnableJpaAuditing注解来配置JPA审计功能。通过设置auditorAwareRef属性可以指定多个实现中的具体哪一个用于审计。提供了具体的配置示例代码。
2622

被折叠的 条评论
为什么被折叠?



