Reports val properties used as JPA entity attributes.
Use of val is discouraged for the following reasons:
-
Immutability of the property only holds when an object is accessed from the source code.
Persistence provider is still able to update properties through reflection.
This might lead to incorrect Kotlin data flow analysis leading to runtime errors.
-
Missing setter and/or final backing field can prevent some features, such as Spring Data JPA Auditing, from working correctly.