You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Michael Bolz (JIRA)" <ji...@apache.org> on 2017/09/23 12:04:00 UTC

[jira] [Comment Edited] (OLINGO-1156) ODataJPAServiceFactory - Cannot create or update entry with ManyToOne association

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

Michael Bolz edited comment on OLINGO-1156 at 9/23/17 12:03 PM:
----------------------------------------------------------------

Hi all,

Just for clarification.
You do a e.g. a POST request for "Alternative" wich includes "Scopes" (as expanded entity) wich should be also created. Correct?
Can you please also provide the sample request payload?

Regards, Michael


was (Author: mirbo):
Hi all,

Just for clarification.
You do a e.g. a POST request for "Atlernative" wich includes "Scopes" (as expanded entity) wich should be also created. Correct?
Can you please also provide the sample request payload?

Regards, Michael

> ODataJPAServiceFactory - Cannot create or update entry with ManyToOne association
> ---------------------------------------------------------------------------------
>
>                 Key: OLINGO-1156
>                 URL: https://issues.apache.org/jira/browse/OLINGO-1156
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata2-jpa
>    Affects Versions: V2 2.0.9
>         Environment: EclipseLink 2.5.2
>            Reporter: Tilo Eilebrecht
>            Assignee: Michael Bolz
>            Priority: Blocker
>         Attachments: Alternative.java, Scope.java
>
>
> My project uses ODataJPAServiceFactory as described in the tutorial for JPA. I have an entity which references another entity with a ManyToOne relationship. If I submit a create or change request, the reference (idAlternative) is not created or updated. As the field is not nullable, object creation fails altogether.
> See my Entities in the attachment. The JoinColumn is idAlternative. 
> I have investigated into possible causes and I stumbled on org.apache.olingo.odata2.jpa.processor.core.access.dataJPAEntity, method write. This method identifies idAlternative as an embeddable key and removes it from the propertyNames set. Therefore it does not get written into the object.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)