rzo1 opened a new pull request, #294:
URL: https://github.com/apache/openjpa/pull/294

   https://issues.apache.org/jira/browse/OPENJPA-2929
   
   When an entity maps the columns of a compound foreign key a second time as 
read-only basic attributes (`@Column(insertable = false, updatable = false)` 
next to `@ManyToOne @JoinColumns`), `RowImpl.setJoinRefColumn()` matched every 
referenced id column against the first owner column. The attribute of the first 
column received each id value in turn, the others none.
   
   Each owner column now gets the join value computed for it, which also covers 
`@EmbeddedId` targets and id columns whose names differ from their field names. 
Note: the spec does not require these read-only attributes to be filled before 
a refresh (footnote to 2.4.1.3); this is an OpenJPA feature, it just filled in 
wrong values for compound keys.
   
   New `TestCompoundRefColumn` (normal and swapped `@JoinColumns` order, 
changed relation, `@EmbeddedId`, renamed id columns; fails without the fix) and 
the existing `TestO2ORefColumn` pass; full `openjpa-persistence-jdbc` suite 
passes on Derby.
   
   CI: the TCK and Databases workflows were started on this branch; this PR 
stays a draft until both pass.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to