You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Kiran G (JIRA)" <ji...@apache.org> on 2014/11/05 06:29:34 UTC

[jira] [Commented] (OLINGO-411) [olingo-jpa] Error on $expand for Self joins

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

Kiran G commented on OLINGO-411:
--------------------------------

Hi Chandan,
The issue with the navigation and $expand is fixed now. However, there is still an issue with the $metadata as Association is not qutie correct.

<Association Name="Employee_Employee">
   <End Type="test_1.0.Employee" Multiplicity="*" Role="Employee" />
   <End Type="test_1.0.Employee" Multiplicity="1" Role="Employee2" />
   <ReferentialConstraint>
      <Principal Role="Employee">
         <PropertyRef Name="id" />
      </Principal>
      <Dependent Role="Employee2">
         <PropertyRef Name="id" />
      </Dependent>
   </ReferentialConstraint>
</Association>

The  Principal Role should have been Employee2 and the PropertyRef name should have been FK_manager_id. This is the correct Association. (Change the muliplicity order in the below snippet)

<Association Name="Employee_Employee">
   <End Type="test_1.0.Employee" Multiplicity="1" Role="Employee" />
   <End Type="test_1.0.Employee" Multiplicity="*" Role="Employee2" />
   <ReferentialConstraint>
      <Principal Role="Employee">
         <PropertyRef Name="id" />
      </Principal>
      <Dependent Role="Employee2">
         <PropertyRef Name="FK_manager_id" />
      </Dependent>
   </ReferentialConstraint>
</Association>

Compare this with other Association Contact_Employee which correctly defines the Property Ref Name.

<Association Name="Contact_Employee">
   <End Type="test_1.0.Employee" Multiplicity="1" Role="Employee" />
   <End Type="test_1.0.Contact" Multiplicity="*" Role="Contact" />
   <ReferentialConstraint>
      <Principal Role="Employee">
         <PropertyRef Name="id" />
      </Principal>
      <Dependent Role="Contact">
         <PropertyRef Name="FK_employee_id" />
      </Dependent>
   </ReferentialConstraint>
</Association>

Regards,
Kiran

> [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.1
>
>         Attachments: 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)