最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

spring boot - Hibernate UpdateTimestamp annotation gives HHH000502 warning - Stack Overflow

programmeradmin1浏览0评论

I use SpringBoot 3.1.5, hibernate, Kotlin 1.9.22.
And I created a DB entity that has a field:

@field:[Column(name = "receivedOn", columnDefinition = "timestamptz") UpdateTimestamp(source = SourceType.DB) ] 
val receivedOn: OffsetDateTime? = null

This field should hold the timestamp of a record modification.
It works as expected but every time when the record is updated (via repository.save()) I see a warning:

HHH000502: The [receivedOn] property of the [...] entity was modified, but it won't be updated because the property is immutable.

It would like to avoid this warning.
Any idea how to do it ?

发布评论

评论列表(0)

  1. 暂无评论