You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Janusz (JIRA)" <ji...@apache.org> on 2018/05/24 13:46:00 UTC

[jira] [Created] (OLINGO-1265) Reading with navigation properties doesn't work

Janusz created OLINGO-1265:
------------------------------

             Summary: Reading with navigation properties doesn't work
                 Key: OLINGO-1265
                 URL: https://issues.apache.org/jira/browse/OLINGO-1265
             Project: Olingo
          Issue Type: Bug
          Components: odata2-jpa
    Affects Versions: V2 2.0.10
         Environment: javaee-api 7.0, jaxrs 3.1.5, postgres 42.2.2, hibernate 5.1.13.Final
            Reporter: Janusz


I've found new 2.0.10 issue.

If I send 
GET .../Example/ODataService.svc/SubEntitys(2)?$format=json
I receive existed DB relevant data with id=2.

But If I request the same data but using defined Navigation Property
GET .../Example/ODataService.svc/MainEntitys(1)/SubEntityDetails(2)?$format=json
I receive exception "Requested entity could not be found."

JPA entities and Navigation Properties are defined ok.
The same request with Olingo 2.0.9 version works ok and receive relevant DB data.

Please fix.

thx,

Janusz

---------------

My entities are:

 

@Entity
@Table(name="MainEntitys")
public class MainEntity{
 
 @Id
 @GeneratedValue(strategy = GenerationType.SEQUENCE)
 private Integer id;
 
 @Column
 private String name;
 
 @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "MainEntity")
 private List<SubEntity> subEntitys = new ArrayList<SubEntity>();

...

}

 

@Entity
@Table(name = "SubEntitys")
public class SubEntity{

@Id
 @GeneratedValue(strategy = GenerationType.SEQUENCE)
 private Integer id;

@Column
 private String name;

@ManyToOne(fetch = FetchType.LAZY)
 @JoinColumn(name = "MainEntity_id", nullable = false)
 private MainEntity mainEntity;

...

}

 

 

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)