jakartaee / jakartaee/persistence

Allow multiple level @InheritanceType

Open
#86 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Priority: Major Type: Improvement
Dominant language
Java
Stars
268
Forks
78
Avg merge
1d 6h
Merged PRs (30d)
13

Description

Hello,

at the moment the spec says the annotation InheritanceType can be used only once - any subsequent uses are just ignored. My suggestion is to allow for multiple uses of this annotation.
For example let's say I have the following hierarchy:

```
AbstractEntity (with InheritanceType=TABLE_PER_CLASS)
\--Product
\--Widget (with InheritanceType=SINGLE_TABLE)
\--Map
\--Carousel
\--Banner
```

I would expect Product and Widget to be in their own tables, but Map, Carousel and Banner to be all in the Widget table. However, currently this is not supported.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the InheritanceType specification and how repeated uses are currently handled. Validate the AbstractEntity/Product/Widget/Map/Carousel/Banner hierarchy, and consider the work complete when the specified table mapping is supported and the annotation rules reflect multiple inheritance strategies.

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
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.