@SpringBootApplication
@EnableJpaAuditing
public class Application {...}
@Component
public class AuditorAwareImpl implements AuditorAware<String> {
public String getCurrentAuditor() {
return "aaa";
}
}
@Entity
@EntityListeners(AuditingEntityListener.class)
public class A {
@CreatedBy
private String addUser;
@LastModifiedBy
private String modifyUser;
@CreatedDate
private LocalDateTime addTime;
@LastModifiedDate
private LocalDateTime modifyTime;
}