Discriminator based inheritance for embeddable types

Description

Support an inheritance mapping for @Embeddable types with a @DiscriminatorColumn.

AFAICT, what this comes down to is extending the boot model to track the various Component and CompositeType, as well as selecting the discriminator and deciding on the EmbeddableInstantiator to use, based on the value.

This can not be combined with a custom CompositeUserType i.e. the features are mutually exclusive, but note that users can already implement this by using a custom CompositeUserType.

Activity

Show:

Beniamin Dziurdza May 22, 2019 at 3:07 PM

Any progress/decision made in context of 6.0 release? (I would like to mention that EclipseLink supports it somehow )

Larry Chu June 7, 2017 at 1:22 PM

Is there an analogous Jira ticket for annotation mapped value object inheritance mappings? Just being able to map a value object inheritance tree is the spirit of this ticket, whereas xml is just a means to an end.

Marcelo Glasberg June 5, 2017 at 4:04 PM

Ok, meanwhile I have included the "Embeddable subclasses embeddable" inspection to my *Hibernate Inspection*s plugin for Intellij IDEA:
https://plugins.jetbrains.com/plugin/7866-hibernate-inspections

Chris Cranford June 5, 2017 at 2:48 PM

This is not "minor".

Actually it isn't, that probably was just overlooked.

Any plans to include this feature in next releases?

I wouldn't count on it in 6.x at the very least. While there are numerous changes in Hibernate 6 that are building the foundation where we can consider Embeddable inheritance support, it's something that is out of scope at least for the initial release. Its also worth mentioning that HBM XML is considered deprecated, so seeing actual support for it within HBM will be highly unlikely anyway. The way forward will be either annotations or JPA orm.xml.

Marcelo Glasberg June 3, 2017 at 8:29 PM

This is not "minor".

Fixed

Details

Assignee

Reporter

Components

Sprint

Fix versions

Priority

Created November 13, 2005 at 9:08 AM
Updated June 27, 2024 at 2:12 PM
Resolved May 14, 2024 at 9:13 AM