[JPA_SPEC-42] Allow null @Embedded Objects Created: 17/Jan/13 Updated: 05/Dec/16
|Remaining Estimate:||Not Specified|
|Time Spent:||Not Specified|
|Original Estimate:||Not Specified|
At the moment, it is not possible to have null @Embedded objects in JPA (while Hibernate, etc allow it). This is quite a common scenario in most domain models that JPA should take into account. The following is an example:
|Comment by neilstockton [ 05/Dec/16 ]|
Just using "optional" doesn't define how a JPA provider can distinguish between a NULL embedded object and an embedded object with null fields.
The JDO spec provided a definition for this problem.
"null-indicator-column" defines which column used by the embedded object is for determining a null object, and "null-indicator-value" defines the value in that column that means we have a null object. So then the JPA provider can persist this null value in the null column on persist of a null embedded object, and ditto when retrieving.