NutzCN Logo
问答 Nutz中 LocalDate 如何在 “@Default”中设置默认值
发布于 1282天前 作者 Nooft 1397 次浏览 复制 上一个帖子 下一个帖子
标签:

@Column(hump = true) @Default("2020-10-14") @Comment("当日交易时间") private LocalDate currentDayWallet;

如上代码设置会抛异常,使用时间戳也不行,异常如下:

Caused by: org.postgresql.util.PSQLException: ERROR: column "current_day_wallet" is of type timestamp without time zone but default expression is of type integer
  建议:You will need to rewrite or cast the expression.
2 回复

没有,. 设置不了, 也许你可以搞个@PrevInsert, 调用个宏什么的

添加回复
请先登陆
回到顶部