[ 
https://issues.apache.org/jira/browse/OPENJPA-2979?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18116530#comment-18116530
 ] 

ASF subversion and git services commented on OPENJPA-2979:
----------------------------------------------------------

Commit e81fbc0002f270551508a0273dd217cb18b46a3c in openjpa's branch 
refs/heads/OPENJPA-2977 from Paulo Cristovão de Araújo Silva Filho
[ https://gitbox.apache.org/repos/asf?p=openjpa.git;h=e81fbc000 ]

Merge pull request #188 from apache/OPENJPA-2979

[OPENJPA-2979] Support composite ids in getReference(entity)

> getReference(entity) fails on composite ids
> -------------------------------------------
>
>                 Key: OPENJPA-2979
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2979
>             Project: OpenJPA
>          Issue Type: Sub-task
>          Components: jpa
>    Affects Versions: 4.2.0
>            Reporter: Maxim Solodovnik
>            Assignee: Richard Zowalla
>            Priority: Major
>             Fix For: 4.2.0
>
>
> Discussion thread: 
> https://github.com/apache/openjpa/pull/144#discussion_r3683004886
> **(medium)** `getReference(T entity)` only extracts the PK when 
> `pkFields.length == 1`; for composite/IdClass/EmbeddedId entities `pk` stays 
> null and the call fails downstream with a misleading "null pk" 
> IllegalArgumentException. Also `entity.getClass()` (line 2657) may be a 
> runtime subclass without direct metadata. Could composite ids be supported 
> via `broker.getObjectId`, or at least fail with an explicit "composite id not 
> supported" message?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to