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 2016/09/20 18:39:20 UTC

[jira] [Reopened] (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 reopened OLINGO-1020:
----------------------------------

No {{2.0.8}} release upcoming   ;o)

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