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/01/16 18:28:27 UTC

[jira] [Resolved] (OLINGO-1020) Association Multiplicity cannot set to 0..1 just 1

     [ https://issues.apache.org/jira/browse/OLINGO-1020?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Bolz resolved OLINGO-1020.
----------------------------------
    Resolution: Fixed

All known issues fixed with [commit dfe17829fa653650b83c8d1f4fd112d9e5e4b19b|https://git1-us-west.apache.org/repos/asf?p=olingo-odata2.git;a=commit;h=dfe17829fa653650b83c8d1f4fd112d9e5e4b19b].

> 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)