jakartaee / jakartaee/persistence

serializable types as basic types

Open
#1,161 12 comments 4 reactions 0 assignees View on GitHub
candidate-for-4
Dominant language
Java
Stars
267
Forks
78
Avg merge
1d 6h
Merged PRs (30d)
13

Description

Since 1.0, the Persistence spec has said that any un-annotated field is basic by default, and also provided a fall-through to Java serialization for unrecognized basic types.

This is a misfeature.

- Storing serialized Java objects in the database is almost always a rubbish thing to do.
- The fall-through prevents the provider from providing meaningful error reports for unrecognized types, or when mapping annotations are missing.
- In case a user *really* wants this, it's quite straightforward to provide an `AttributeConverter`.

So I think we should at least deprecate this, and perhaps even consider having some way to just turn this "feature" off.

Thoughts?

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the Persistence spec sections covering un-annotated fields, basic types, Java serialization, and AttributeConverter. The issue does not name implementation files or tests, and its open question is whether to deprecate serialization or provide a way to disable it. Done would require a decided scope and corresponding specification and compatibility work.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.