Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 369962

Summary: Inheritance mode not correctly generated in JPA
Product: [Modeling] EMFT Reporter: Benoit Cantin <cantinbe>
Component: TexoAssignee: Martin Taal <mtaal>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Use case none

Description Benoit Cantin CLA 2012-01-27 11:26:15 EST
Build Identifier: Version: 3.7.0 Build id: I20110613-1736

In an annotation model, add the following :

Annotated EClass -> ORM mapping -> Inheritance

Generate JPA annotated model : the default inheritance mode is correctly set (in fact no strategy is generated which is correct).

Now, if in Annotated EClass -> ORM mapping -> Inheritance you explicitly specify SINGLE_TABLE (change to JOINED for example and go back on SINGLE_TABLE), then the annotation generated is not correct :

@Inheritance(strategy=SINGLETABLE) is generated instead of @Inheritance(strategy=SINGLE_TABLE)

See the attached .ecore.

My Texo version : 0.1.0.v201112171308.

Reproducible: Always
Comment 1 Benoit Cantin CLA 2012-01-27 11:26:44 EST
Created attachment 210200 [details]
Use case

Use case attached.
Comment 2 Benoit Cantin CLA 2012-01-27 11:32:09 EST
Sorry, generated JPA code is @Inheritance(strategy = InheritanceType.SINGLETABLE) and not @Inheritance(strategy=SINGLE_TABLE) as said in the description.

I also verified with TABLE_PER_CLASS mode. It is also incorrectly generated (generated value is @Inheritance(strategy = InheritanceType.TABLEPERCLASS)).
Comment 3 Martin Taal CLA 2012-01-30 06:40:28 EST
Build is done and published