Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 359802 - Uniqueness validation for constraints when using mappedsuperclass
Summary: Uniqueness validation for constraints when using mappedsuperclass
Status: RESOLVED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: Teneo (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Martin Taal CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-04 04:54 EDT by Thomas Schindl CLA
Modified: 2011-12-05 16:27 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Schindl CLA 2011-10-04 04:54:54 EDT
When using a mapped super class the generated hbm.xml and hence the generated DDL holds duplicate constraints. The problem is that constraint name is always copied from the mapped-super-class:

MyBaseClass(=mapped-super-class)
  + person: Person

MySubClass extends MyBaseClass:
  + ...

MySubClass2 extends MyBaseClass:
  + ...

The FK-Constraint name is derived from the MyBaseClass and results in MYBASECLASS_PERSON and is now applied to the MySubClass and MySubClass2. The correct solution is to check if the FK-Constraint is coming from a mapped super class and prefix it with the concrete class.
Comment 1 Martin Taal CLA 2011-12-05 16:27:47 EST
Fixed in latest teneo build