You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@olingo.apache.org by Mark Sztainbok <ma...@okta.com> on 2014/10/15 23:53:50 UTC

RE: How to add a relationship between objects via $links

I never got a reply to this.

If I have a OData v3 service and need to create a relationship via $links how do I do that with a proxy? If I use the code below it does a POST to the entity collection to add the entity which isn't what I actually want.

I'm looking for how to get the proxy to utilize section 10.2.4 of the OData 3.0 spec.

From: Mark Sztainbok
Sent: Monday, September 08, 2014 4:53 PM
To: user@olingo.apache.org
Subject: How to add a relationship between objects via $links

How do I add a relationship which requires the $link URL?

I tried code like this but it just tried adding it to the navigation property directly which failed:
                Group group = this.getGroupById(groupId);
        User user = this.getUserById(userId);
        group.getMembers().add(user);
        this.container.flush();

In WCF Data Services, you would call AddRelatedObject on the context. Does Olingo work in a similar way? If not, how do I establish this relationship?

Thanks,
Mark



RE: How to add a relationship between objects via $links

Posted by Mark Sztainbok <ma...@okta.com>.
I did a search through the code for $links and I couldn't see any client code or tests which utilize it. Is it supported? If not, when will it be as this is one of the basic building blocks of OData?

From: Bolz, Michael [mailto:michael.bolz@sap.com]
Sent: Wednesday, October 15, 2014 10:39 PM
To: user@olingo.apache.org
Subject: Re: How to add a relationship between objects via $links

Hi Mark,

sorry for not responding, but currently I myself have a lot of work with OData V4 feature implementation and I don't know the current state of Francesco which is the expert for client and OData V3 issues.
>From my side I can only promise to take a look into this during next week if nobody else could help.

Kind regards,
Michael

On 15 Oct 2014, at 23:53, Mark Sztainbok <ma...@okta.com>> wrote:


I never got a reply to this.

If I have a OData v3 service and need to create a relationship via $links how do I do that with a proxy? If I use the code below it does a POST to the entity collection to add the entity which isn't what I actually want.

I'm looking for how to get the proxy to utilize section 10.2.4 of the OData 3.0 spec.

From: Mark Sztainbok
Sent: Monday, September 08, 2014 4:53 PM
To: user@olingo.apache.org<ma...@olingo.apache.org>
Subject: How to add a relationship between objects via $links

How do I add a relationship which requires the $link URL?

I tried code like this but it just tried adding it to the navigation property directly which failed:
                Group group = this.getGroupById(groupId);
        User user = this.getUserById(userId);
        group.getMembers().add(user);
        this.container.flush();

In WCF Data Services, you would call AddRelatedObject on the context. Does Olingo work in a similar way? If not, how do I establish this relationship?

Thanks,
Mark




Re: How to add a relationship between objects via $links

Posted by "Bolz, Michael" <mi...@sap.com>.
Hi Mark,

sorry for not responding, but currently I myself have a lot of work with OData V4 feature implementation and I don’t know the current state of Francesco which is the expert for client and OData V3 issues.
From my side I can only promise to take a look into this during next week if nobody else could help.

Kind regards,
Michael

On 15 Oct 2014, at 23:53, Mark Sztainbok <ma...@okta.com> wrote:

> I never got a reply to this.
>  
> If I have a OData v3 service and need to create a relationship via $links how do I do that with a proxy? If I use the code below it does a POST to the entity collection to add the entity which isn’t what I actually want.
>  
> I’m looking for how to get the proxy to utilize section 10.2.4 of the OData 3.0 spec.
>  
> From: Mark Sztainbok 
> Sent: Monday, September 08, 2014 4:53 PM
> To: user@olingo.apache.org
> Subject: How to add a relationship between objects via $links
>  
> How do I add a relationship which requires the $link URL?
>  
> I tried code like this but it just tried adding it to the navigation property directly which failed:
>                 Group group = this.getGroupById(groupId);
>         User user = this.getUserById(userId);
>         group.getMembers().add(user);
>         this.container.flush();
>  
> In WCF Data Services, you would call AddRelatedObject on the context. Does Olingo work in a similar way? If not, how do I establish this relationship?
>  
> Thanks,
> Mark