You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@olingo.apache.org by Nicolas Prömper <np...@prosic.de> on 2017/01/06 13:02:41 UTC

Problem with $select

Hi List,

I have to say, that I am new to OData and Olingo. Currently I am
building my first OData service. Right now, I have it working for the
first EntitySet, but there is a behaviour that seems to be wrong for
me.

I have an EntitySet Users with is based on the following EntityType. As
you can see, both columns are marked as "NOT NULL".

<EntityType Name="User"><Key><PropertyRef Name="Login"/></Key><Property
Name="Login" Type="Edm.String" Nullable="false"/><Property
Name="Passwd" Type="Edm.String" Nullable="false"/></EntityType>

When I request now only column "Login" from this EntitySet, I am
getting an error.

http://localhost:8080/OData/Users('nick')?$select=Login

<error><code/><message xml:lang="de">The metadata do not allow a null
value.</message></error>

Obviously that is because of the missing property "Passwd" in the
ResultSet. If I add this column in the $select option or remove the
"not null" facet, everything works fine.

The example service works as I would expect it:

http://services.odata.org/OData/Odata.svc/Products(0)?$select=Name,Description&$format=json
Is there something missing in my EdmProvider or is it a bug of Olingo
V2.0?

Thanks in advance
Nick