[hibernate-issues] [Hibernate-JIRA] Closed: (HHH-1534) Class hierarchy per table without discriminators / ignore subclass type and values

Steve Ebersole (JIRA) noreply at atlassian.com
Mon Mar 21 13:00:51 EDT 2011


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1534?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steve Ebersole closed HHH-1534.
-------------------------------


Closing stale resolved issues

> Class hierarchy per table without discriminators / ignore subclass type and values
> ----------------------------------------------------------------------------------
>
>                 Key: HHH-1534
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1534
>             Project: Hibernate Core
>          Issue Type: New Feature
>    Affects Versions: 3.1
>            Reporter: Mattias Jiderhamn
>            Priority: Minor
>
> I would like to see the ability of mapping a class hierarchy to a single table without any discriminators. That is, only the values of the mapped superclass are persisted and when the entity is loaded from database, it will have the type of the superclass.
> Example:
> class Foo {
>   
>   int a;
>   
>   int b;
> }
> class SubFoo extends Foo {
>   int c;
>   
>   int d;
> }
> In this case, I want to be able to instantiate SubFoo, set the values of a, b, c and d, store the SubFoo and later retreive it as a Foo (not only refereced by a Foo pointer, but actually being a Foo instance).
> I do not wish to persist c and d, since they are only used for calculating a and b when the instance is first created.
> I can achieve this by having a separate, identical mapping for each class, but as there are lots of properties and collections it will be hard to maintain.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list