JPA entity with val attributes
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.
Locating this inspection
- By ID
Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.
JpaEntityWithValAttributesInspection- Via Settings dialog
Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.
Inspection ID: JpaEntityWithValAttributesInspection
Suppressing Inspection
You can suppress this inspection by placing the following comment marker before the code fragment where you no longer want messages from this inspection to appear:
More detailed instructions as well as other ways and options that you have can be found in the product documentation:
Inspection Details | |
|---|---|
By default bundled with: |