jakartaee / jakartaee/persistence

clarify when an @Embedded field is null

Open
#42 12 comments 1 reaction 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.