You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@olingo.apache.org by Paul Boldijar <pa...@3sstudio.com> on 2015/02/04 15:23:55 UTC

Re: Problem with Olingo V4

Hey.
Did you tried something?

Also, I have another problem.
I have the field ToFarmId, which is an integer.

 @org.apache.olingo.ext.proxy.api.annotations.Property(name = "ToFarmId",
                type = "Edm.Int32",
                nullable = true,
                defaultValue = "",
                maxLenght = Integer.MAX_VALUE,
                fixedLenght = false,
                precision = 0,
                scale = 0,
                unicode = true,
                collation = "",
                srid = "",
                concurrencyMode = ConcurrencyMode.None,
                fcSourcePath = "",
                fcTargetPath = "",
                fcContentKind = EdmContentKind.text,
                fcNSPrefix = "",
                fcNSURI = "",
                fcKeepInContent = false)
    java.lang.Integer getToFarmId();

Let's say I do something like
Integer number = null ;
someEntity.setToFarmId(number);

And when I add that entity to the server the request body sends a null
String, when it should be a null integer.

ToFarmId@odata.type":"String","ToFarmId":null,



And this will generate a 400 Bad Request error code.

Thanks !




On Fri, Jan 30, 2015 at 4:53 PM, Paul Boldijar <pa...@3sstudio.com>
wrote:

> I've already provided.
>
>  OdataHelper.getInstance().getContainer().flush();
>                 AnimalCollection collection =
> OdataHelper.getInstance().getContainer().getAnimals().top(5).execute();
>                 Animal animal = collection.iterator().next();
>                 animal.getName();
>                 animal.getCode();
>                 animal.getBreed().load();
>
>                 OdataHelper.getInstance().getContainer().flush();
>
> The first flush does nothing (as it should be)
> The second flush should not do anything, because I didn't set anything
> with the olingo entities, but it generates a PATCH request (full request
> above).
>
>
> On Fri, Jan 30, 2015 at 4:35 PM, Fabio Martelli <fa...@gmail.com>
> wrote:
>
>> Il 30/01/2015 15:28, Paul Boldijar ha scritto:
>>
>>> But I didn't made any change.
>>> If i go through my app i will get a lot of patches when I do flush to
>>> add something. Like 1 good post request for adding, and 10 + useless
>>> patches..
>>>
>>> Thanks for your reply!
>>>
>> Hi Paul, if you can, please provide complete sample code and all the
>> related post/patch requests sent to the server.
>> Thank you in advance.
>>
>> Kind regards,
>>
>> F.
>>
>>
>> --
>> Fabio Martelli
>>
>> Tirasa - Open Source Excellence
>> http://www.tirasa.net/
>>
>> Apache Syncope PMC
>> http://people.apache.org/~fmartelli/
>>
>>
>

Re: Problem with Olingo V4

Posted by Fabio Martelli <fa...@gmail.com>.
Hi Paul, see my comments in-line.
Regards,
F.

Il 04/02/2015 15:23, Paul Boldijar ha scritto:
> Hey.
> Did you tried something?
>
> Also, I have another problem.
> I have the field ToFarmId, which is an integer.
>
>  @org.apache.olingo.ext.proxy.api.annotations.Property(name = "ToFarmId",
>                 type = "Edm.Int32",
>                 nullable = true,
>                 defaultValue = "",
>                 maxLenght = Integer.MAX_VALUE,
>                 fixedLenght = false,
>                 precision = 0,
>                 scale = 0,
>                 unicode = true,
>                 collation = "",
>                 srid = "",
>                 concurrencyMode = ConcurrencyMode.None,
>                 fcSourcePath = "",
>                 fcTargetPath = "",
>                 fcContentKind = EdmContentKind.text,
>                 fcNSPrefix = "",
>                 fcNSURI = "",
>                 fcKeepInContent = false)
>     java.lang.Integer getToFarmId();
>
> Let's say I do something like
> Integer number = null ;
> someEntity.setToFarmId(number);
>
> And when I add that entity to the server the request body sends a null 
> String, when it should be a null integer.
> ToFarmId@odata.type":"String","ToFarmId":null,
> And this will generate a 400 Bad Request error code.

You are right. I've just opened a new issue about this bug.
See https://issues.apache.org/jira/browse/OLINGO-561

>
> On Fri, Jan 30, 2015 at 4:53 PM, Paul Boldijar 
> <paul.boldijar@3sstudio.com <ma...@3sstudio.com>> wrote:
>
>     I've already provided.
>      OdataHelper.getInstance().getContainer().flush();
>           AnimalCollection collection =
>     OdataHelper.getInstance().getContainer().getAnimals().top(5).execute();
>           Animal animal = collection.iterator().next();
>           animal.getName();
>           animal.getCode();
>           animal.getBreed().load();
>
>     OdataHelper.getInstance().getContainer().flush();
>
>     The first flush does nothing (as it should be)
>     The second flush should not do anything, because I didn't set
>     anything with the olingo entities, but it generates a PATCH
>     request (full request above).
>

I confirm, this is the way the client proxy is working now.
This aspect has been object of several improvements in the past. Maybe 
we can do better then this but not sure about the results.

If you want you can try to provide a patch to fix this inefficiency.

-- 
Fabio Martelli

Tirasa - Open Source Excellence
http://www.tirasa.net/

Apache Syncope PMC
http://people.apache.org/~fmartelli/