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

Gyula Árpád Tóth commented on OLINGO-837:
-----------------------------------------

Hi [~mirbo],

I created a small test app with an example 
https://github.com/tothgya/olingo-test

The JPA entity is here:  
https://github.com/tothgya/olingo-test/blob/master/olingo-test/src/test/java/hu/tothgya/olingo/TestEntity.java

The junit test creates 3 entities in a hierarchy. t1<-t2<-t3. The navigational 
property name is 'parent'. If you check the output of the test call, you will 
see that the if I request t3 and expand parent and parent/parent 
TestEntitys(2)/parent (t1) will not be expanded.
{code:xml}
<?xml version="1.0" encoding="UTF-8"?><entry 
xmlns="http://www.w3.org/2005/Atom"; 
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"; 
xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"; 
xml:base="http://localhost:8180/svc/";>
  <id>http://localhost:8180/svc/TestEntitys(3)</id>
  <title type="text">TestEntitys</title>
  <updated>2016-01-22T15:10:29.718+01:00</updated>
  <category term="test.TestEntity" 
scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
  <link href="TestEntitys(3)" rel="edit" title="TestEntity"/>
  <link href="TestEntitys(3)/children" 
rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/children"; 
title="children" type="application/atom+xml;type=feed"/>
  <link href="TestEntitys(3)/parent" 
rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/parent"; 
title="parent" type="application/atom+xml;type=entry">
    <m:inline>
      <entry xml:base="http://localhost:8180/svc/";>
        <id>http://localhost:8180/svc/TestEntitys(2)</id>
        <title type="text">TestEntitys</title>
        <updated>2016-01-22T15:10:29.719+01:00</updated>
        <category term="test.TestEntity" 
scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
        <link href="TestEntitys(2)" rel="edit" title="TestEntity"/>
        <link href="TestEntitys(2)/children" 
rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/children"; 
title="children" type="application/atom+xml;type=feed"/>
        <link href="TestEntitys(2)/parent" 
rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/parent"; 
title="parent" type="application/atom+xml;type=entry">
          <m:inline/>
        </link>
        <content type="application/xml">
          <m:properties>
            <d:data>t2</d:data>
            <d:id>2</d:id>
          </m:properties>
        </content>
      </entry>
    </m:inline>
  </link>
  <content type="application/xml">
    <m:properties>
      <d:data>t3</d:data>
      <d:id>3</d:id>
    </m:properties>
  </content>
</entry>
{code}
I am not familiar with easymock, so I did not make modifications to the 
{{org.apache.olingo.odata2.jpa.processor.core.access.data.JPAExpandCallBackTest}}.

Thanks,
Gyula

> JPAExpandCallBack uses FromRole when validating a navigation property name
> --------------------------------------------------------------------------
>
>                 Key: OLINGO-837
>                 URL: https://issues.apache.org/jira/browse/OLINGO-837
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata2-jpa
>    Affects Versions: V2 2.0.5
>            Reporter: Gyula Árpád Tóth
>            Assignee: Michael Bolz
>            Priority: Minor
>         Attachments: 0001-OLINGO-837-getNextNavigationProperty-fix.patch
>
>
> Navigation property name validations in JPAExpandCallBack will fail if the 
> FromRole is numbered.
> I suggest to cut the numbering from the FromRole and do the compare without 
> it.



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

Reply via email to