Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 369962 - Inheritance mode not correctly generated in JPA
Summary: Inheritance mode not correctly generated in JPA
Status: RESOLVED FIXED
Alias: None
Product: EMFT
Classification: Modeling
Component: Texo (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Martin Taal CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-27 11:26 EST by Benoit Cantin CLA
Modified: 2012-01-30 06:40 EST (History)
0 users

See Also:


Attachments
Use case (5.96 KB, application/zip)
2012-01-27 11:26 EST, Benoit Cantin CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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