Bug 243492

Summary: JPA entity wizard adds @Inheritance to child class
Product: [WebTools] Dali JPA Tools Reporter: John Pitman <jpitman>
Component: JPAAssignee: Neil Hauge <neil.hauge>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: d.dimitrov, danny.ju, karenfbutzke, neil.hauge
Version: 2.0Keywords: helpwanted
Target Milestone: Future   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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.