[
https://issues.apache.org/jira/browse/OLINGO-411?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14204422#comment-14204422
]
Chandan V.A commented on OLINGO-411:
------------------------------------
Hi Kiran,
I believe the metadata is correct for the following reasons.
1) Association is a relationship between two Entity Types. In case of Self
Joins the Entity Types are same, with one of the bound entity type acts as a
dependent and the other as a principal.
2) We can traverse from one bound entity to other using Navigation property.
These navigation properties use the association definition to do the traversal.
3) There can be multiple navigation properties in an Entity bound to a single
Association. However during runtime based on the navigation property used in
the URL defines what data to be fetched.
In the above use case
1) The JPA Entity Employee has 3 navigation properties - Manager, Mentee,
Mentor all bound to the same Relationship which binds Entity Type Employee with
itself in 1..N cardinality. This is the reason why JPA Entity Provider creates
only one association element and the same association element is reused for 3
different navigation properties whose relationship definition are the same.
2) When you do a navigation say service/Employeess/Mentee it is expected out of
runtime (JPA Processor in this case) to return you the Mentee of the Employee.
I hope this clarifies your question. Please revert in case the above argument
is not valid. Nevertheless I will open up this JIRA item for further discussion
in Olingo dev group for further clarification.
Regards
Chandan
> [olingo-jpa] Error on $expand for Self joins
> --------------------------------------------
>
> Key: OLINGO-411
> URL: https://issues.apache.org/jira/browse/OLINGO-411
> Project: Olingo
> Issue Type: Bug
> Components: odata2-jpa
> Affects Versions: V2 2.0.0
> Reporter: Kiran G
> Assignee: Chandan V.A
> Fix For: V2 2.0.2
>
> Attachments: Employee.java, metadata.xml, metadata.xml,
> olingo-bug-association.zip, olingo-bug.zip
>
>
> If there is a self join in the JPA entity then the $expand fails. Also, the
> relationship names seem to be duplicated for both side of relationship.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)