【发布时间】:2020-02-20 00:08:45
【问题描述】:
我有一个简单的实体,我想让“createdDate”自动分配。
@CreatedDate
private LocalDateTime createdDate;
正如documentation 所述,我还在我的 CassandraConfig 中添加了注释“@EnableCassandraAuditing”:
@Configuration
@EnableCassandraRepositories
@EnableCassandraAuditing
public class CassandraConfig extends AbstractCassandraConfiguration {
但它仍然不起作用.. 实体是使用 createdDate=null 创建的。 任何帮助表示赞赏。
【问题讨论】:
-
缺少配置您的
Auditable User,您需要创建自己的实现,因为这不起作用。
标签: spring spring-boot cassandra spring-data