jakartaee / jakartaee/persistence

Value types in JPA

Open
#1,164 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
267
Forks
78
Avg merge
1d 6h
Merged PRs (30d)
13

Description

[Value Objects](https://openjdk.org/jeps/401) have been integrated into Java 28 in preview mode. Is there any bearing on JPA with regard to value objects that needs to be documented or implemented in the future? A lot of the Basic types will be [converted](https://openjdk.org/jeps/401#Programming-with-value-objects) to value objects.

For example, if I declare
```java
value class Pages {

private long pages; // implicitly final
}
```
will there be any difference with respect to the same class without the `value` declaration?

It will be some time before value types leave preview, but it's good to have some foresight for JPA/JakartaEE because their releases are less frequent than Java's.

Contributor guide

Open the contributing guide

Research direction

Start by reading JEP 401 and its section on programming with value objects, then compare its value-class constraints with the JPA treatment of basic types and embeddable classes. Use the Pages example to identify whether persistence behavior or specification guidance would change; done requires a decided, documented compatibility position or a clearly scoped implementation plan.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.