本文共 457 字,大约阅读时间需要 1 分钟。
We provide @CreatedBy, @LastModifiedBy to capture the user who created or modified the entity as well as @CreatedDate and @LastModifiedDate to capture the point in time this happened.
当使用@CreatedBy时会使用下用户名
@Componentpublic class SpringSecurityAuditorAware implements AuditorAware{@Override public String getCurrentAuditor() { return "shangzebei"; }}
如果类实现了AuditorAware程序就会自动使用此类的实例,如果有多个同时实现就可以通过@EnableJpaAuditing中auditorAwareRef指定
转载地址:http://ydmub.baihongyu.com/