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

One-to-Many self-link causing NotImplementedException

    XMLWordPrintableJSON

Details

    Description

      An exception will be thrown when expanding an inline entity which is a one-to-many relationship to the entity itself.

      My entity model:
      @EdmEntityType
      @EdmEntitySet(name="Manufacturers")
      public class Manufacturer {

      @EdmKey
      @EdmProperty
      private String id;

      @EdmProperty
      private String name;

      @EdmProperty
      private Calendar founded;

      @EdmNavigationProperty
      private List<Car> cars;

      @EdmNavigationProperty
      private List<Manufacturer> subManufacturers;

      }

      Request: http://localhost:8080/PqmODataExample/PqmODataExample.svc/Manufacturers('1')?$expand=SubManufacturers

      Response:
      {"error":{"code":null,"message":

      {"lang":"en","value":"Not implemented"}

      }}

      A workaround is to add toRole to the navigation property annotation as "@EdmNavigationProperty(toRole="r-manufacturers")".

      Attachments

        Activity

          People

            mirbo mibo
            Yaofeng Yaofeng Xu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: