0

I've got an abstract BasicEntity class implementing Persistable. It's purpose to set basic fields :

    @CreatedDate
    @Column(value = "create_time")
    private Long createTime;

    @CreatedBy
    @Column(value = "create_user")
    private String createUser;

    @LastModifiedDate
    @Column(value = "last_modify_time")
    private Long lastModifyTime;

    @LastModifiedBy
    @Column(value = "last_modify_user")
    private String lastModifyUser;

It sets

 spring.application.name: my_app

to the field lastModifyUser and it makes a timestamp for the lastModifyTime, but createTime and createUser are nulls after saving entity. Any advice ?

tarmogoyf
  • 298
  • 3
  • 17

1 Answers1

1

You have two options. In the entity you can indicate the annotation @EnableR2dbcAuditing

Or, create a configuration class

@Configuration
@EnableR2dbcAuditing
class DatabaseConfig{

}
jorozco
  • 11
  • 2