Hibernate Explicit Inheritance Strategy
ID |
java.hibernate_explicit_inheritance_strategy |
Severity |
info |
Remediation Complexity |
trivial |
Remediation Risk |
low |
Remediation Effort |
low |
Resource |
Reliability |
Language |
Java |
Tags |
hibernate, orm |
Description
Reports @Inheritance annotations without an explicit strategy attribute. The default strategy is SINGLE_TABLE, which is rarely the right choice for non-trivial hierarchies and should be stated explicitly to document the design decision.
Rationale
Reliability — The implicit SINGLE_TABLE strategy may cause unexpected null columns and discriminator issues when the hierarchy grows. An explicit strategy makes the intent clear.