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

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

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 ?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1743763374a4503047.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信