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

Bug 313574

Summary: Lower case primary key column association does not work when upper casing flag is set to true
Product: z_Archived Reporter: Guy Pelletier <guy.pelletier>
Component: EclipselinkAssignee: Guy Pelletier <guy.pelletier>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipselink.orm-inbox
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed changes
none
Amendment to original fix none

Description Guy Pelletier CLA 2010-05-19 12:50:27 EDT
Example:

<entity name="Boat" class="Boat" access="PROPERTY">
  ...
  <primary-key-join-column name="boat_id" referenced-column-name="id"/>


<entity name="Person" class="Person" access="PROPERTY">
  ...
  <attributes>
    <many-to-one name="boat" target-entity="Boat">
      <join-column name="b_id" referenced-column-name="boat_id"/>
    </many-to-one>

Our code to associate boat_id with Bus's parent 'id' column would fail if the uppercasing flag was set to true (which it is by default)

Reason:
 1- Primary key join columns are processed first and upper cased
 2- By the time we process the many-to-one, when we look up the primary key association for 'boat_id' it won't be found since on the association map it will be 'BOAT_ID' and we therefore don't find the association.
Comment 1 Guy Pelletier CLA 2010-05-20 11:02:12 EDT
Created attachment 169358 [details]
Proposed changes
Comment 2 Guy Pelletier CLA 2010-05-20 11:18:15 EDT
Changes have been submitted.

Reviewed by: Chris Delahunt

Tests: New test (testPKJoinColumnAssociation) added to EntityMappingsInheritanceJUnitTestCase
Comment 3 Guy Pelletier CLA 2010-05-20 13:36:29 EDT
Created attachment 169385 [details]
Amendment to original fix

After review from Gordon Yorke.

Takes into consideration delimeted identifiers
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:07:20 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink