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

Michael Bolz commented on OLINGO-1020:
--------------------------------------

Hi [~ZoltanBeleznay],

There were some strange/edge cases for which the {{0..1}} was not set correctly.
Can you please check with current SNAPSHOT (based on [this 
commit|https://git1-us-west.apache.org/repos/asf?p=olingo-odata2.git;a=commit;h=7d882075a5b7058c34ff092abe2dac3c216d9382])
 and give feedback.

Thanks and Best Regards, Michael

> Association Multiplicity cannot set to 0..1 just 1
> --------------------------------------------------
>
>                 Key: OLINGO-1020
>                 URL: https://issues.apache.org/jira/browse/OLINGO-1020
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata2-jpa
>    Affects Versions: V2 2.0.7
>            Reporter: Zoltan Beleznay
>            Assignee: Michael Bolz
>             Fix For: V2 2.0.8
>
>
> Association Multiplicity cannot set to 0..1 just 1
> We created some navigation like the following (in the many side):
>       @ManyToOne
>       @PrimaryKeyJoinColumn(name = "SIDE_ONE_OBJECT_ID")
>       private OneObject parentOneObject;
> and from the other side:
>       @OneToMany(mappedBy = "parentOneObject")
>       private List<ManyObject> manyObjects;
> but it creates the following part of the metadata:
>       <Association Name="ManyObject_OneObject_One_Many0">
>               <End Type="Service.ManyObject" Multiplicity="*" 
> Role="ManyObject"/>
>               <End Type="Service.OneObject" Multiplicity="1" 
> Role="OneObject"/>
>       </Association>
> We would like to see in the one side the 0..1 multiplicity, so we changed the 
> annotations to the following:
>       @ManyToOne(optional = true)
>       @JoinColumn(name = "ACTION_PARENT_WORK_PACKAGE_ID", insertable = false, 
> updatable = false, nullable = true)
>       private OneObject parentOneObject;
> and from the other side:
>       @OneToMany(mappedBy = "parentOneObject")
>       private List<ManyObject> manyObjects;
> We expected the following result in metadata:
>       <Association Name="ManyObject_OneObject_One_Many0">
>               <End Type="Service.ManyObject" Multiplicity="*" 
> Role="ManyObject"/>
>               <End Type="Service.OneObject" Multiplicity="0..1" 
> Role="OneObject"/>
>       </Association>
> But it did not bring us the expected behaviour and the corresponding part of 
> the metadata remained the same.
> The 0..1 is accesible via the EdmMultiplicity.ZERO_TO_ONE enum, and it is 
> part of the OData documentation.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to