You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@olingo.apache.org by Jonas Vachal <jo...@vertex-controls.com> on 2015/06/18 18:47:31 UTC

[Olingo4] Should a navigation property evaluate to a complex type?

The following line of code results in a an exception stating Usupported object type scantegra.Entities.Models.Location

CoreUtils.addProperties(edmClient, map, newEntity);

Map in this context is a Map<String, Object> generated with a method identical to BeanUtils.describe.  In this context the POJO being mapped contains primitive types as well as one referenced pojo that contains primitive types as well.  The metadata describing the objects is included below.

What I am really after is to map an object into a cliententity using the native methods in the Olingo4 library.  If I map the objects into a ClientEntity manually and add the location as a complex type the post works fine.

Anyone have any ideas here or can you recommend a better way to do this?

Thanks!

J.

<EntityType Name="Asset">
<Key>
<PropertyRef Name="assetId"/>
</Key>
<Property Name="assetId" Type="Edm.Int32" Nullable="false"/>
<Property Name="ipaddress" Type="Edm.String" Nullable="false"/>
<Property Name="name" Type="Edm.String"/>
<Property Name="snmpEnabled" Type="Edm.Boolean" Nullable="false"/>
<Property Name="snmpCommunity" Type="Edm.String"/>
<Property Name="assetType" Type="scantegra.Entities.Models.AssetType" Nullable="false"/>
<Property Name="macAddress" Type="Edm.String"/>
<Property Name="lastContact" Type="Edm.DateTimeOffset" Nullable="false"/>
<Property Name="lastModel" Type="Edm.DateTimeOffset" Nullable="false"/>
<Property Name="interfaceCount" Type="Edm.Int32" Nullable="false"/>
<Property Name="uptime" Type="Edm.Int32" Nullable="false"/>
<Property Name="modelNumber" Type="Edm.String"/>
<NavigationProperty Name="location" Type="scantegra.Entities.Models.Location"/>
<NavigationProperty Name="manufacturer" Type="scantegra.Entities.Models.Manufacturer"/>
</EntityType>
<EntityType Name="Location">
<Key>
<PropertyRef Name="locationID"/>
</Key>
<Property Name="locationID" Type="Edm.Int32" Nullable="false"/>
<Property Name="locationName" Type="Edm.String"/>
<Property Name="address1" Type="Edm.String"/>
<Property Name="address2" Type="Edm.String"/>
<Property Name="city" Type="Edm.String"/>
<Property Name="state" Type="Edm.String"/>
<Property Name="zip" Type="Edm.String"/>
<Property Name="phone" Type="Edm.String"/>
<NavigationProperty Name="clientID" Type="scantegra.Entities.Models.Client"/>
</EntityType>