Issue Details (XML | Word | Printable)

Key: HHH-1152
Type: New Feature New Feature
Status: Open Open
Priority: Minor Minor
Assignee: Unassigned
Reporter: Vjeran Marcinko
Votes: 21
Watchers: 17
Operations

If you were logged in you would be able to see more operations.
Hibernate Core

Value object(<component>) inheritance mapping

Created: 13/Nov/05 01:08 AM   Updated: 05/Jan/10 01:35 PM
Component/s: core
Affects Version/s: 3.1 beta 2
Fix Version/s: None

Time Tracking:
Not Specified

Issue Links:
Prerequisite
 

Participants: Chris Florian, Ilya Boyandin, Jonni Gani, Max Rydahl Andersen, Stefan Fromm and Vjeran Marcinko


 Description  « Hide

Though fine-grained object mapping is one of Hibernate's main objectives, it still doesn't support value object (<component>) inheritance mapping, only entity inheritance mapping.
It would be best if <component> tag could also contain similar tags for inheritance as entity does.



Max Rydahl Andersen added a comment - 14/Nov/05 02:16 AM

definitly not minor and you should be able to do this with a paramaterzied compositeusertype


Jonni Gani added a comment - 11/Jun/07 08:27 AM

Just to echo Vjeran, component inheritance similar to entity inheritance would be good, though the one I'm particularly interested in is 'Table per class hierarchy' with a discriminator column. This issue should get a higher priority as it's essential for good model design with proper distinction between Entity and Value Object.


Ilya Boyandin added a comment - 16/Jul/08 03:34 AM

It's definitely not minor. In the absence of this feature changes have to be made to the domain model to workaround the problem.

I think it would be very easy to implement it at least for the "table per class hierarchy" strategy. Others don't necessarily have to be supported.


Stefan Fromm added a comment - 07/Nov/08 07:07 AM

I'm trying to implement the Role Object Pattern for domain objects. I would need component inheritance for the role objects. Treating them as entities is not possible, because they appear to be the same object as their core object - they have the same identity. Adding more than 1 role object to the core object results in a NonUniqueObjectException. I have to change back my domain model to the Extension Object Pattern where the extension/role objects are not identical to their core object.

I agree with Ilya. "table per class hierarchy" would suffice initially.


Chris Florian added a comment - 05/Jan/10 01:35 PM

I'd like to chime in that this is a major issue and effects our data models significantly.