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

Bug 359802

Summary: Uniqueness validation for constraints when using mappedsuperclass
Product: [Modeling] EMF Reporter: Thomas Schindl <tom.schindl>
Component: TeneoAssignee: Martin Taal <mtaal>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

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