Bug 243492 - JPA entity wizard adds @Inheritance to child class
Summary: JPA entity wizard adds @Inheritance to child class
Status: NEW
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: JPA (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: Future   Edit
Assignee: Neil Hauge CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2008-08-07 16:43 EDT by John Pitman CLA
Modified: 2011-07-01 16:23 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Pitman CLA 2008-08-07 16:43:31 EDT
Build ID: WTP 3.0.1

Steps To Reproduce:
If you use the JPA entity wizard to create a new entity and specify a superclass of an existing entity, and check the "Inheritance" checkbox, the child entity is created with an @Inheritance annotation.

The spec says that @Inheritance must be on the root of the entity hierarchy, so this seems wrong.

[01171671]

More information:
Comment 1 Karen Butzke CLA 2008-12-12 14:25:25 EST
I disagree that this is a bug.  The spec supports changing inheritance strategies in a class hierarchy.  

JPA spec section 9.1.29 :
The Inheritance annotation defines the inheritance strategy to be used for an entity class hierarchy. It is specified on the entity class that is the root of the entity class hierarchy.

Support for the combination of inheritance strategies is not required by this specification. Portable applications should only use a single inheritance strategy within an entity hierarchy.



I think the key here is *entity* class hierarchy.  This doesn't mean the top of the class hierarchy.  I think the wording is slightly confusing, since really if you put an @Inheritance you are defining that to be the root of this entity hierarchy.  As soon as you put another @Inheritance in the class hierarchy, then you've defined a new root and the strategy changes.  As the spec says, this is not portable, but I see no reason for us to disallow it in the entity wizard.
Comment 2 Neil Hauge CLA 2011-07-01 16:23:19 EDT
Moving JPA specific bugs to new JPA component in bugzilla.