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

Bug 330237

Summary: Tables are created in unspecified order (DDL creation)
Product: z_Archived Reporter: Sei Syvalta <syvalta>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: eclipselink.foundation-inbox, michael.f.obrien, peter.krogh, tom.ware
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard: submitted_patch
Attachments:
Description Flags
Simple patch to fix the problem peter.krogh: iplog+

Description Sei Syvalta CLA 2010-11-15 07:40:11 EST
Build Identifier: svn trunk (2.2.0), r8499

If you create DDL multiple times it results in different order for the create statements every time. This makes it very difficult to track what has actually changed.

Reproducible: Always

Steps to Reproduce:
1. Create DDL
2. Copy it to another name
2. Create DDL again
3. diff the backup copy and the new version to see the changed order
Comment 1 Sei Syvalta CLA 2010-11-15 07:48:09 EST
Created attachment 183118 [details]
Simple patch to fix the problem

A quick patch to fix the problem. I think the most important change is to call getOrderedDescriptors and change tableMap to an ordered map. I'm not sure if rest of the HashMap --> LinkedHashMap changes are really needed (I would guess they are but didn't analyze that far).
Comment 2 Tom Ware CLA 2010-11-19 14:12:00 EST
Checked into Trunk

Tested Manually and with JPA LRG and DDL Generation tests

Reviewed by: Tom Ware - reviewed user submitted patch
Comment 3 Peter Krogh CLA 2010-12-08 14:30:40 EST
moving ipLog flag to patch
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:34:16 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink