Uploaded image for project: 'Olingo'
  1. Olingo
  2. OLINGO-1265

Reading with navigation properties doesn't work

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • V2 2.0.10
    • None
    • odata2-jpa
    • javaee-api 7.0, jaxrs 3.1.5, postgres 42.2.2, hibernate 5.1.13.Final

    Description

      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; ... }

       

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            Janusz Janusz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: