You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by Madhawa Kasun Gunasekara <ma...@gmail.com> on 2015/07/15 13:08:21 UTC

[OlingoV4] Merge property in updateEntity

Hi Devs,

What should we do when merge is not true in updateEntity method in
serviceHandler ? Should we delete the entity and create a new entity? I
have attached the method signature for your easy reference.

Any help on this matter is highly appreciated.

public void updateEntity(DataRequest request, Entity entity, boolean
merge, String eTag,
    EntityResponse response)


Thanks,
Madhawa

Re: [OlingoV4] Merge property in updateEntity

Posted by Ramesh Reddy <ra...@redhat.com>.
corrected the issue with https://issues.apache.org/jira/browse/OLINGO-738 

----- Original Message -----

> Thanks Ralf.

> The interface as designed is correct, but looks like I missed "upsertEntity"
> call, when there are no "if-match" headers, I was still issuing a
> "updateEntity". I will correct the implementation.

> Madhava: Can you log a JIRA for this?

> Thanks

> Ramesh..

> ----- Original Message -----

> > Not sure about “If the entity not found then it should be an error”: OData
> > V4
> > allows UPSERT, i.e. PUT/PATCH to non-existing entities, see
> > http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part1-protocol/odata-v4.0-errata02-os-part1-protocol-complete.html#_Delete_an_Entity
> > .
> 

> > If these requests are dispatched to updateEntity, then it can well happen
> > that the entity doesn’t exist yet.
> 

> > From: Ramesh Reddy [mailto:rareddy@redhat.com]
> 
> > Sent: Mittwoch, 15. Juli 2015 15:12
> 
> > To: user@olingo.apache.org
> 
> > Subject: Re: [OlingoV4] Merge property in updateEntity
> 

> > The below is from the documentation of the interface
> 

> > /**
> 
> > * Update the entity object.
> 
> > * @param request
> 
> > * @param entity
> 
> > * @param merge - true if merge operation, false it needs to be replaced
> 
> > * @param entityETag - previous entity tag if provided by the user. "*"
> > means
> > allow.
> 
> > * @param response
> 
> > * @throws ODataLibraryException
> 
> > * @throws ODataApplicationException
> 
> > */
> 

> > If "merge" is "true", then merge with current entity, if "false" replace
> > the
> > current entity. If the entity not found then it should be an error. Let me
> > if we can change this to better wording..
> 

> > BTW, please do NOT post to both dev@olingo.org as well as user@olingo.org
> > mailing lists. These types of questions need to be asked on user@olingo.org
> > and dev@olingo.org need to used to discuss any Olingo development type
> > questions.
> 

> > Thanks
> 

> > Ramesh..
> 
> > ----- Original Message -----
> 

> > > Hi Devs,
> > 
> 

> > > What should we do when merge is not true in updateEntity method in
> > > serviceHandler ? Should we delete the entity and create a new entity? I
> > > have
> > > attached the method signature for your easy reference.
> > 
> 

> > > Any help on this matter is highly appreciated.
> > 
> 
> > > public void updateEntity(DataRequest request, Entity entity, boolean
> > > merge,
> > > String eTag,
> > 
> 
> > > EntityResponse response)
> > 
> 

> > > Thanks,
> > 
> 

> > > Madhawa
> > 
> 

Re: [OlingoV4] Merge property in updateEntity

Posted by Ramesh Reddy <ra...@redhat.com>.
Thanks Ralf. 

The interface as designed is correct, but looks like I missed "upsertEntity" call, when there are no "if-match" headers, I was still issuing a "updateEntity". I will correct the implementation. 

Madhava: Can you log a JIRA for this? 

Thanks 

Ramesh.. 

----- Original Message -----

> Not sure about “If the entity not found then it should be an error”: OData V4
> allows UPSERT, i.e. PUT/PATCH to non-existing entities, see
> http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part1-protocol/odata-v4.0-errata02-os-part1-protocol-complete.html#_Delete_an_Entity
> .

> If these requests are dispatched to updateEntity, then it can well happen
> that the entity doesn’t exist yet.

> From: Ramesh Reddy [mailto:rareddy@redhat.com]
> Sent: Mittwoch, 15. Juli 2015 15:12
> To: user@olingo.apache.org
> Subject: Re: [OlingoV4] Merge property in updateEntity

> The below is from the documentation of the interface

> /**
> * Update the entity object.
> * @param request
> * @param entity
> * @param merge - true if merge operation, false it needs to be replaced
> * @param entityETag - previous entity tag if provided by the user. "*" means
> allow.
> * @param response
> * @throws ODataLibraryException
> * @throws ODataApplicationException
> */

> If "merge" is "true", then merge with current entity, if "false" replace the
> current entity. If the entity not found then it should be an error. Let me
> if we can change this to better wording..

> BTW, please do NOT post to both dev@olingo.org as well as user@olingo.org
> mailing lists. These types of questions need to be asked on user@olingo.org
> and dev@olingo.org need to used to discuss any Olingo development type
> questions.

> Thanks

> Ramesh..
> ----- Original Message -----

> > Hi Devs,
> 

> > What should we do when merge is not true in updateEntity method in
> > serviceHandler ? Should we delete the entity and create a new entity? I
> > have
> > attached the method signature for your easy reference.
> 

> > Any help on this matter is highly appreciated.
> 
> > public void updateEntity(DataRequest request, Entity entity, boolean merge,
> > String eTag,
> 
> > EntityResponse response)
> 

> > Thanks,
> 

> > Madhawa
> 

RE: [OlingoV4] Merge property in updateEntity

Posted by "Handl, Ralf" <ra...@sap.com>.
Not sure about “If the entity not found then it should be an error”: OData V4 allows UPSERT, i.e. PUT/PATCH to non-existing entities, see http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part1-protocol/odata-v4.0-errata02-os-part1-protocol-complete.html#_Delete_an_Entity.

If these requests are dispatched to updateEntity, then it can well happen that the entity doesn’t exist yet.

From: Ramesh Reddy [mailto:rareddy@redhat.com]
Sent: Mittwoch, 15. Juli 2015 15:12
To: user@olingo.apache.org
Subject: Re: [OlingoV4] Merge property in updateEntity

The below is from the documentation of the interface


/**
* Update the entity object.
* @param request
* @param entity
* @param merge - true if merge operation, false it needs to be replaced
* @param entityETag - previous entity tag if provided by the user. "*" means allow.
* @param response
* @throws ODataLibraryException
* @throws ODataApplicationException
*/

If "merge" is "true", then merge with current entity, if "false" replace the current entity. If the entity not found then it should be an error. Let me if we can change this to better wording..

BTW, please do NOT post to both dev@olingo.org<ma...@olingo.org> as well as user@olingo.org<ma...@olingo.org> mailing lists. These types of questions need to be asked on user@olingo.org<ma...@olingo.org> and dev@olingo.org<ma...@olingo.org> need to used to discuss any Olingo development type questions.

Thanks

Ramesh..
________________________________
Hi Devs,

What should we do when merge is not true in updateEntity method in serviceHandler ? Should we delete the entity and create a new entity? I have attached the method signature for your easy reference.

Any help on this matter is highly appreciated.

public void updateEntity(DataRequest request, Entity entity, boolean merge, String eTag,
    EntityResponse response)

Thanks,
Madhawa


Re: [OlingoV4] Merge property in updateEntity

Posted by Ramesh Reddy <ra...@redhat.com>.
The below is from the documentation of the interface 

/** 
* Update the entity object. 
* @param request 
* @param entity 
* @param merge - true if merge operation, false it needs to be replaced 
* @param entityETag - previous entity tag if provided by the user. "*" means allow. 
* @param response 
* @throws ODataLibraryException 
* @throws ODataApplicationException 
*/ 

If "merge" is "true", then merge with current entity, if "false" replace the current entity. If the entity not found then it should be an error. Let me if we can change this to better wording.. 

BTW, please do NOT post to both dev@olingo.org as well as user@olingo.org mailing lists. These types of questions need to be asked on user@olingo.org and dev@olingo.org need to used to discuss any Olingo development type questions. 

Thanks 

Ramesh.. 
----- Original Message -----

> Hi Devs,

> What should we do when merge is not true in updateEntity method in
> serviceHandler ? Should we delete the entity and create a new entity? I have
> attached the method signature for your easy reference.

> Any help on this matter is highly appreciated.
> public void updateEntity(DataRequest request, Entity entity, boolean merge,
> String eTag,
> EntityResponse response)

> Thanks,
> Madhawa