@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;

}

 

相关文章:

  • 2021-07-28
  • 2021-06-09
  • 2022-12-23
  • 2021-12-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-07
  • 2021-05-04
  • 2021-11-16
  • 2021-04-30
  • 2021-12-12
  • 2021-06-27
  • 2021-11-07
相关资源
相似解决方案