Spring JPA Data Auditing

官方文档
baeldung 示例

注意:
来自官方文档:

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 auditorProvider() {
        return new AuditorAwareImpl();
    }

    ...

}

你可能感兴趣的:(Spring JPA Data Auditing)