我有一些字段标记为@Column(name = "column1", updatable = false)的实体在jpa资源库中,它的工作原理,但当保存实体时,会显示这样的警告信息。
2020-04-23 18:48:34.358 WARN 1112 --- [nio-8080-exec-6] o.h.p.entity.AbstractEntityPersister : HHH000502: The [column1] property of the [com.nodobanka.core.data.model.Entity1] entity was modified, but it won't be updated because the property is immutable.
我只想知道如何才能阻止这个警告打印在日志中?
你可以设置日志级别 org.hibernate.persister.entity
包给 ERROR
. 这样,它就会只显示带有以下内容的日志 ERROR
和 FATAL
级别。
你可以在 在application.properties文件中添加以下一行,就可以实现Spring的功能。:
logging.level.org.hibernate.persister.entity: ERROR