jakartaee / jakartaee/persistence
clarify when an @Embedded field is null
Open
candidate-for-4.1
Priority: Minor
Type: Improvement
- Dominant language
- Java
- Stars
- 268
- Forks
- 78
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 13
Description
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:
public class Employee {
...
@Embedded(optional=true) // This should be possible since the employee entity can be null in some
// stages of it's life-cycle
private Address address;
...
}
Contributor guide
Research direction
The issue provides only an Employee/Address example using @Embedded and names no repository file or test. Start by reviewing the JPA specification's @Embedded semantics and current null-handling behavior; done means the intended behavior for null embedded objects is defined and accompanied by an agreed specification change or test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- database
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 32/100