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/01/07 15:27:34 UTC

Problem with Olingo V4

Hello!
I'm using Olingo V4 with android.

I have a base entity A, and some derrived classes, such as entity B, and C.

If I want to get all A entities from another entity, the class of the java
object is always A, even if the object is a B entity.

The wierd thing is that if I load all the A entities from the container,
everything is ok, the type of the java objects are the right ones.

And also, can I get from an odata entity to a 'EntityInvocationHandler'
object?

Thank you.

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/


Re: Problem with Olingo V4

Posted by Paul Boldijar <pa...@3sstudio.com>.
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 Paul Boldijar <pa...@3sstudio.com>.
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>.
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 Paul Boldijar <pa...@3sstudio.com>.
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!

Re: Problem with Olingo V4

Posted by Fabio Martelli <fa...@gmail.com>.
Il 30/01/2015 14:20, Paul Boldijar ha scritto:
> Using that method, we could find out more properties about odata, and 
> we can find which type the entity really is.
> But we still can't cast them, we are getting the same error, 
> Proxy<number> cannot be casted to X...
Hi Paul,
have you tried out with something like as following

X.class.cast(Proxy.getInvocationHandler(proxyinstance));

>
> And also, i have another problem, olingo is generating wierd patches.
> I have this code
>  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();
>
> I don't set anything as you can see.
> The second flush generates a request
>
> PATCH IP/Animals(1) HTTP/1.1
> Accept: application/json;odata.metadata=full
> Content-Type: application/json;odata.metadata=full
> If-Match: W/"YmluYXJ5J0FBQUFBQUFBQi9FPSc="
> OData-MaxVersion: 4.0
> OData-Version: 4.0
> Prefer: return-content
> Content-ID: 1
>
> {"@odata.type":"#VAS.Model.Animal","@odata.id 
> <http://odata.id>":"IP/Animals(1)","Name@odata.type":"String","Name":"Dodge","Code@odata.type":"String","Code":"D1"}
>
>
> While using the app there are a lot of patches generated.

This is  the right behaviour: calling "flush" method you are asking to 
flush every change performed and cached from the previous flush till now.
By default, Olingo proxy client keep in memory every write operation 
until the commit is called explicitly by flush method.
All the operations performed between two different flush requests are 
executed in a single transaction. If an error occurs then all the write 
operations are rolled-back (if supported by the server).

Of course, of you want a non-transactional mode can be configured 
working with the provided NonTransactionalPersistenceManager.

Kind regards,
F.

>
>
> On Thu, Jan 29, 2015 at 5:11 PM, Fabio Martelli 
> <fabio.martelli@gmail.com <ma...@gmail.com>> wrote:
>
>     Hi Alex, do you have any update about this topic.
>
>     Kind regards,
>     F.
>
>     Il 22/01/2015 22:46, Fabio Martelli ha scritto:
>>     Il 22/01/2015 17:57, Alex Maiereanu ha scritto:
>>>
>>>     Thank you Fabio for the pointers.  We will  try to make due :)
>>>
>>     Hi Alex, try with
>>
>>     Proxy.getInvocationHandler(proxyinstance)
>>
>>     to get underlying type of the proxy object.
>>
>>     Kind regards,
>>     F.
>>
>>>     On Jan 22, 2015 5:58 PM, "Fabio Martelli"
>>>     <fabio.martelli@gmail.com <ma...@gmail.com>> wrote:
>>>
>>>         Hi Alex, sorry but not yet. I will try to take a look at it
>>>         during next week.
>>>
>>>         In the meanwhile, take a look below for some comments.
>>>
>>>         Kind regards,
>>>         F.
>>>
>>>         Il 22 gennaio 2015 16:31:00 CET, Alex Maiereanu
>>>         <alex.maiereanu@3sstudio.com
>>>         <ma...@3sstudio.com>> ha scritto:
>>>         >Hello Fabio,
>>>         >
>>>         >Did you had time to have a look over the issue?
>>>         >
>>>         > Salutari din Brasov /  Greetings from Brasov
>>>         >
>>>         >Alex-Paul Maiereanu
>>>         >
>>>         >+40 761 684 212 <tel:%2B40%20761%20684%20212>
>>>         >
>>>         >www.3sstudio.com <http://www.3sstudio.com>
>>>         >
>>>         >Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
>>>         ><https://twitter.com/SmartSocialSoft> Google+
>>>         ><https://plus.google.com/101299629750815349588/posts>
>>>         >
>>>         >On Thu, Jan 15, 2015 at 3:00 PM, Paul Boldijar
>>>         ><paul.boldijar@3sstudio.com
>>>         <ma...@3sstudio.com>>
>>>         >wrote:
>>>         >
>>>         >> Ok here is the exact problem.
>>>         >> A client has a deposit, which has a collection of stocks.
>>>         A stock has
>>>         >a
>>>         >> field for material.
>>>         >>
>>>         >>
>>>         >> client.expand("Deposit").load();
>>>         What is the purpose of this request?
>>>
>>>         >>             Deposit clientDeposit = client.getDeposit();
>>>         >>             Integer id = clientDeposit.getId();
>>>         >>             StockCollection clientStocks =
>>>         >> clientDeposit.getStocks().expand("Material").execute();
>>>         >>             // a stock has a Material field
>>>         >>             for (Stock stock : clientStocks) {
>>>         >>                 Material material = stock.getMaterial();
>>>         >>                 // here , the materials don't have the
>>>         derived class
>>>         >type,
>>>         >> if this Material is on the server a instance of Vaccine
>>>         (which is
>>>         >derrived
>>>         >> from Material),
>>>         This is normal: you asked for material
>>>         Try with
>>>
>>>         .execute(Vaccine.class)
>>>
>>>         This is used to filter on types.
>>>
>>>         >>                 // material instanceof Vaccine will
>>>         always return
>>>         >false
>>>         >>                 // and material.getClass.getName() will
>>>         always be
>>>         >$Proxy3
>>>
>>>         This will always return a proxy instance: each returned
>>>         object is a proxies object.
>>>         You can retrieve the real proxied instance type when ever
>>>         you want. Please search in the web; if you won't find the
>>>         solution, please let me know, I can provide the solution.
>>>
>>>         >>
>>>         >>             }
>>>         >>
>>>         >> The imports are ok
>>>         >> import
>>>         com.studio3s.vetandroid.veterinarian.Model.Odata.Service;
>>>         >> import
>>>         >>
>>>         >com.studio3s.vetandroid.veterinarian.Model.Odata.entitysets.Container;
>>>         >>
>>>         >> import org.apache.olingo.client.api.v4.EdmEnabledODataClient;
>>>         >> import
>>>         >org.apache.olingo.client.core.android.http.AndroidHttpClientFactory;
>>>         >>
>>>         >> And i'm loading the container like this
>>>         >>   mService = Service.getV4("the ip);
>>>         >>
>>>         >mService.getClient().getConfiguration().setHttpClientFactory(new
>>>         >> AndroidHttpClientFactory());
>>>         >>         mContainer =
>>>         mService.getEntityContainer(Container.class);
>>>         >>
>>>         >>
>>>         >> Thanks.
>>>         >>
>>>         >>
>>>         >> On Tue, Jan 13, 2015 at 10:48 AM, Fabio Martelli
>>>         ><fabio.martelli@gmail.com <ma...@gmail.com>
>>>         >> > wrote:
>>>         >>
>>>         >>>  Il 12/01/2015 17:08, Paul Boldijar ha scritto:
>>>         >>>
>>>         >>> Hey, here you go, the metadata
>>>         >>>
>>>         >>>
>>>         >>> Hi Paul, it seems to work fine.
>>>         >>> Can you provide a snipped code reporting your issue.
>>>         Please, include
>>>         >>> imports.
>>>         >>>
>>>         >>> Please, check into your imports to be sure to include
>>>         from v4
>>>         >package
>>>         >>> only (v3 package shouldn't appear).
>>>         >>> Pay attention to EdmEnabledODataClient. See below an example
>>>         >>>
>>>         >>> Best regards,
>>>         >>> F.
>>>         >>>
>>>         >>> package net.tirasa.test.olingoproxysample;
>>>         >>>
>>>         >>> import
>>>         >>>
>>>         net.tirasa.olingoproxysample.net.azurewebsites.odatae2etest.Service;
>>>         >>> import
>>>         >>>
>>>         >net.tirasa.olingoproxysample.net.azurewebsites.odatae2etest.entitysets.Container;
>>>         >>> import
>>>         >>>
>>>         >net.tirasa.olingoproxysample.net.azurewebsites.odatae2etest.vas.model.types.MaterialCollection;
>>>         >>> import
>>>         >>>
>>>         >net.tirasa.olingoproxysample.net.azurewebsites.odatae2etest.vas.model.types.MedicationCollection;
>>>         >>> import
>>>         org.apache.olingo.client.api.v4.EdmEnabledODataClient;
>>>         >>> import org.apache.olingo.commons.api.format.ContentType;
>>>         >>>
>>>         >>> public class Main {
>>>         >>>
>>>         >>>     public static void main(final String[] args) {
>>>         >>>         final Service<EdmEnabledODataClient> service =
>>>         >Service.getV4(
>>>         >>> "http://www.tirasa.net/olingo/services"
>>>         >>> <http://www.tirasa.net/olingo/services>);
>>>         >>>
>>>         >>>
>>>         >service.getClient().getConfiguration().setDefaultBatchAcceptFormat(ContentType.APPLICATION_OCTET_STREAM);
>>>         >>>         final Container container =
>>>         >>> service.getEntityContainer(Container.class);
>>>         >>>
>>>         >>>         final MaterialCollection materials =
>>>         >>> container.getMaterials().execute();
>>>         >>>         final MedicationCollection medication =
>>>         >>>
>>>         container.getMaterials().execute(MedicationCollection.class);
>>>         >>>
>>>         >>>
>>>         >>>     }
>>>         >>> }
>>>         >>>
>>>         >>>
>>>         >>> On Mon, Jan 12, 2015 at 3:37 PM, Fabio Martelli
>>>         ><fabio.martelli@gmail.com <ma...@gmail.com>
>>>         >>> > wrote:
>>>         >>>
>>>         >>>>  Il 12/01/2015 14:33, Alex Maiereanu ha scritto:
>>>         >>>>
>>>         >>>>  Hello Fabio,
>>>         >>>>
>>>         >>>>  I know that you are doing this in your spare time.
>>>         Maybe we can
>>>         >also
>>>         >>>> help you with some of the bug fixing stuff, but since
>>>         we don't know
>>>         >the
>>>         >>>> piping we depend on your knowledge :)
>>>         >>>>
>>>         >>>>  We are generating from a V4 Service using ASP.net Web Api.
>>>         >>>> Medication and Materials are from the same Odata
>>>         service, same
>>>         >container.
>>>         >>>>
>>>         >>>>  Hi Alex, it seems to be a bug in proxy class generation.
>>>         >>>> Can you attach your metadata (preferred option) or
>>>         something to
>>>         >help me
>>>         >>>> to reproduce the problem?
>>>         >>>>
>>>         >>>> Kind regards,
>>>         >>>>
>>>         >>>> F.
>>>         >>>>
>>>         >>>>
>>>         >>>>   Salutari din Brasov / Greetings from Brasov
>>>         >>>>
>>>         >>>> Alex-Paul Maiereanu
>>>         >>>>
>>>         >>>> +40 761 684 212 <tel:%2B40%20761%20684%20212>
>>>         >>>>
>>>         >>>> www.3sstudio.com <http://www.3sstudio.com>
>>>         >>>>
>>>         >>>> Facebook <https://www.facebook.com/smartsocialsoftware>
>>>         Twitter
>>>         >>>> <https://twitter.com/SmartSocialSoft> Google+
>>>         >>>> <https://plus.google.com/101299629750815349588/posts>
>>>         >>>>
>>>         >>>> On Mon, Jan 12, 2015 at 3:24 PM, Fabio Martelli <
>>>         >>>> fabio.martelli@gmail.com
>>>         <ma...@gmail.com>> wrote:
>>>         >>>>
>>>         >>>>>  Il 12/01/2015 13:44, Alex Maiereanu ha scritto:
>>>         >>>>>
>>>         >>>>> Hello again,
>>>         >>>>>
>>>         >>>>>  So, could somebody from the Olingo team tell me if
>>>         the Proxy
>>>         >classes
>>>         >>>>> for Olingo are actually maintained? We can't get any
>>>         support
>>>         >regarding this
>>>         >>>>> part of the technologie. Should we start moving our
>>>         code to the
>>>         >common
>>>         >>>>> factory classes?
>>>         >>>>>
>>>         >>>>>  Hi Alex, Proxy classes are maintained by me and
>>>         someone else in
>>>         >best
>>>         >>>>> effort during spare time.
>>>         >>>>> I can try to give you my help about your last request
>>>         but I need
>>>         >to
>>>         >>>>> understand your case better.
>>>         >>>>>
>>>         >>>>> 1. are you generating the proxy from a an OData v3
>>>         service?
>>>         >>>>> 2. Medication and Materials are entity of the same
>>>         OData service?
>>>         >Same
>>>         >>>>> container?
>>>         >>>>>
>>>         >>>>> Please, consider that the same proxy (v3 or v4) has to be
>>>         >generated
>>>         >>>>> from the same service.
>>>         >>>>> If this doesn't happen, a bug or configuration problem is
>>>         >occurring.
>>>         >>>>>
>>>         >>>>> Please, let me know.
>>>         >>>>> Best regards,
>>>         >>>>> F.
>>>         >>>>>
>>>         >>>>>
>>>         >>>>>
>>>         >>>>>   Salutari din Brasov / Greetings from Brasov
>>>         >>>>>
>>>         >>>>> Alex-Paul Maiereanu
>>>         >>>>>
>>>         >>>>> +40 761 684 212 <tel:%2B40%20761%20684%20212>
>>>         <%2B40%20761%20684%20212>
>>>         >>>>>
>>>         >>>>> www.3sstudio.com <http://www.3sstudio.com>
>>>         >>>>>
>>>         >>>>> Facebook
>>>         <https://www.facebook.com/smartsocialsoftware> Twitter
>>>         >>>>> <https://twitter.com/SmartSocialSoft> Google+
>>>         >>>>> <https://plus.google.com/101299629750815349588/posts>
>>>         >>>>>
>>>         >>>>> On Thu, Jan 8, 2015 at 5:33 PM, Alex Maiereanu <
>>>         >>>>> alex.maiereanu@3sstudio.com
>>>         <ma...@3sstudio.com>> wrote:
>>>         >>>>>
>>>         >>>>>> Hello everybody,
>>>         >>>>>>
>>>         >>>>>>  To add some more information. Paul is using the
>>>         Client Proxy
>>>         >>>>>> classes. The problem is that when the proxies are
>>>         generated from
>>>         >the
>>>         >>>>>> container. The instances classes are dynamically
>>>         generated.
>>>         >>>>>>
>>>         >>>>>>  So for a material entity we have a Proxy3 instance type.
>>>         >>>>>> Medication Entity, that is derived from Material. will be
>>>         >generated as
>>>         >>>>>> Proxy4.
>>>         >>>>>>
>>>         >>>>>>  This names we get if we run method getClass().
>>>         >>>>>>
>>>         >>>>>>  Our problem is that, if we have a list of Materials, and
>>>         >afterwards
>>>         >>>>>> we want to cast this Material to a Medication, the
>>>         instance type
>>>         >will be of
>>>         >>>>>> Proxy3 and not Proxy4, so we cant figure out if the
>>>         material is a
>>>         >material
>>>         >>>>>> or a medication.
>>>         >>>>>>
>>>         >>>>>>
>>>         >>>>>>   Salutari din Brasov /  Greetings from Brasov
>>>         >>>>>>
>>>         >>>>>> Alex-Paul Maiereanu
>>>         >>>>>>
>>>         >>>>>> +40 761 684 212 <tel:%2B40%20761%20684%20212>
>>>         <%2B40%20761%20684%20212>
>>>         >>>>>>
>>>         >>>>>> www.3sstudio.com <http://www.3sstudio.com>
>>>         >>>>>>
>>>         >>>>>> Facebook
>>>         <https://www.facebook.com/smartsocialsoftware> Twitter
>>>         >>>>>> <https://twitter.com/SmartSocialSoft> Google+
>>>         >>>>>> <https://plus.google.com/101299629750815349588/posts>
>>>         >>>>>>
>>>         >>>>>> On Wed, Jan 7, 2015 at 4:27 PM, Paul Boldijar <
>>>         >>>>>> paul.boldijar@3sstudio.com
>>>         <ma...@3sstudio.com>> wrote:
>>>         >>>>>>
>>>         >>>>>>> Hello!
>>>         >>>>>>> I'm using Olingo V4 with android.
>>>         >>>>>>>
>>>         >>>>>>>  I have a base entity A, and some derrived classes,
>>>         such as
>>>         >entity
>>>         >>>>>>> B, and C.
>>>         >>>>>>>
>>>         >>>>>>>  If I want to get all A entities from another
>>>         entity, the class
>>>         >of
>>>         >>>>>>> the java object is always A, even if the object is a
>>>         B entity.
>>>         >>>>>>>
>>>         >>>>>>>  The wierd thing is that if I load all the A
>>>         entities from the
>>>         >>>>>>> container, everything is ok, the type of the java
>>>         objects are
>>>         >the right
>>>         >>>>>>> ones.
>>>         >>>>>>>
>>>         >>>>>>>  And also, can I get from an odata entity to a
>>>         >'EntityInvocationHandler'
>>>         >>>>>>> object?
>>>         >>>>>>>
>>>         >>>>>>>  Thank you.
>>>         >>>>>>>
>>>         >>>>>>
>>>         >>>>>>
>>>         >>>>>
>>>         >>>>>
>>>         >>>>>   --
>>>         >>>>> Fabio Martelli
>>>         >>>>>
>>>         >>>>> Tirasa - Open Source Excellencehttp://www.tirasa.net/
>>>         <http://www.tirasa.net/>
>>>         >>>>>
>>>         >>>>> Apache Syncope PMChttp://people.apache.org/~fmartelli/
>>>         <http://people.apache.org/%7Efmartelli/>
>>>         >>>>>
>>>         >>>>>
>>>         >>>>
>>>         >>>>
>>>         >>>> --
>>>         >>>> Fabio Martelli
>>>         >>>>
>>>         >>>> Tirasa - Open Source Excellencehttp://www.tirasa.net/
>>>         <http://www.tirasa.net/>
>>>         >>>>
>>>         >>>> Apache Syncope PMChttp://people.apache.org/~fmartelli/
>>>         <http://people.apache.org/%7Efmartelli/>
>>>         >>>>
>>>         >>>>
>>>         >>>
>>>         >>>
>>>         >>> --
>>>         >>> Fabio Martelli
>>>         >>>
>>>         >>> Tirasa - Open Source Excellencehttp://www.tirasa.net/
>>>         <http://www.tirasa.net/>
>>>         >>>
>>>         >>> Apache Syncope PMChttp://people.apache.org/~fmartelli/
>>>         <http://people.apache.org/%7Efmartelli/>
>>>         >>>
>>>         >>>
>>>         >>
>>>
>>>         -- Inviato dal mio cellulare Android con K-9 Mail.
>>>
>>
>>
>>     -- 
>>     Fabio Martelli
>>
>>     Tirasa - Open Source Excellence
>>     http://www.tirasa.net/
>>
>>     Apache Syncope PMC
>>     http://people.apache.org/~fmartelli/  <http://people.apache.org/%7Efmartelli/>
>
>
>     -- 
>     Fabio Martelli
>
>     Tirasa - Open Source Excellence
>     http://www.tirasa.net/
>
>     Apache Syncope PMC
>     http://people.apache.org/~fmartelli/  <http://people.apache.org/%7Efmartelli/>
>
>


-- 
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 Paul Boldijar <pa...@3sstudio.com>.
Using that method, we could find out more properties about odata, and we
can find which type the entity really is.
But we still can't cast them, we are getting the same error, Proxy<number>
cannot be casted to X...

And also, i have another problem, olingo is generating wierd patches.
I have this code
 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();

I don't set anything as you can see.
The second flush generates a request

PATCH IP/Animals(1) HTTP/1.1
Accept: application/json;odata.metadata=full
Content-Type: application/json;odata.metadata=full
If-Match: W/"YmluYXJ5J0FBQUFBQUFBQi9FPSc="
OData-MaxVersion: 4.0
OData-Version: 4.0
Prefer: return-content
Content-ID: 1

{"@odata.type":"#VAS.Model.Animal","@odata.id
":"IP/Animals(1)","Name@odata.type":"String","Name":"Dodge","Code@odata.type
":"String","Code":"D1"}


While using the app there are a lot of patches generated.


On Thu, Jan 29, 2015 at 5:11 PM, Fabio Martelli <fa...@gmail.com>
wrote:

>  Hi Alex, do you have any update about this topic.
>
> Kind regards,
> F.
>
> Il 22/01/2015 22:46, Fabio Martelli ha scritto:
>
> Il 22/01/2015 17:57, Alex Maiereanu ha scritto:
>
> Thank you Fabio for the pointers.  We will  try to make due :)
>
> Hi Alex, try with
>
> Proxy.getInvocationHandler(proxyinstance)
>
> to get underlying type of the proxy object.
>
> Kind regards,
> F.
>
>  On Jan 22, 2015 5:58 PM, "Fabio Martelli" <fa...@gmail.com>
> wrote:
>
>> Hi Alex, sorry but not yet. I will try to take a look at it during next
>> week.
>>
>> In the meanwhile, take a look below for some comments.
>>
>> Kind regards,
>> F.
>>
>> Il 22 gennaio 2015 16:31:00 CET, Alex Maiereanu <
>> alex.maiereanu@3sstudio.com> ha scritto:
>> >Hello Fabio,
>> >
>> >Did you had time to have a look over the issue?
>> >
>> > Salutari din Brasov /  Greetings from Brasov
>> >
>> >Alex-Paul Maiereanu
>> >
>> >+40 761 684 212 <%2B40%20761%20684%20212>
>> >
>> >www.3sstudio.com
>> >
>> >Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
>> ><https://twitter.com/SmartSocialSoft> Google+
>> ><https://plus.google.com/101299629750815349588/posts>
>> >
>> >On Thu, Jan 15, 2015 at 3:00 PM, Paul Boldijar
>> ><pa...@3sstudio.com>
>> >wrote:
>> >
>> >> Ok here is the exact problem.
>> >> A client has a deposit, which has a collection of stocks. A stock has
>> >a
>> >> field for material.
>> >>
>> >>
>> >> client.expand("Deposit").load();
>> What is the purpose of this request?
>>
>> >>             Deposit clientDeposit = client.getDeposit();
>> >>             Integer id = clientDeposit.getId();
>> >>             StockCollection clientStocks =
>> >> clientDeposit.getStocks().expand("Material").execute();
>> >>             // a stock has a Material field
>> >>             for (Stock stock : clientStocks) {
>> >>                 Material material = stock.getMaterial();
>> >>                 // here , the materials don't have the derived class
>> >type,
>> >> if this Material is on the server a instance of Vaccine (which is
>> >derrived
>> >> from Material),
>> This is normal: you asked for material
>> Try with
>>
>> .execute(Vaccine.class)
>>
>> This is used to filter on types.
>>
>> >>                 // material instanceof Vaccine will always return
>> >false
>> >>                 // and material.getClass.getName() will always be
>> >$Proxy3
>>
>> This will always return a proxy instance: each returned object is a
>> proxies object.
>> You can retrieve the real proxied instance type when ever you want.
>> Please search in the web; if you won't find the solution, please let me
>> know, I can provide the solution.
>>
>> >>
>> >>             }
>> >>
>> >> The imports are ok
>> >> import com.studio3s.vetandroid.veterinarian.Model.Odata.Service;
>> >> import
>> >>
>> >com.studio3s.vetandroid.veterinarian.Model.Odata.entitysets.Container;
>> >>
>> >> import org.apache.olingo.client.api.v4.EdmEnabledODataClient;
>> >> import
>> >org.apache.olingo.client.core.android.http.AndroidHttpClientFactory;
>> >>
>> >> And i'm loading the container like this
>> >>   mService = Service.getV4("the ip);
>> >>
>> >mService.getClient().getConfiguration().setHttpClientFactory(new
>> >> AndroidHttpClientFactory());
>> >>         mContainer = mService.getEntityContainer(Container.class);
>> >>
>> >>
>> >> Thanks.
>> >>
>> >>
>> >> On Tue, Jan 13, 2015 at 10:48 AM, Fabio Martelli
>> ><fabio.martelli@gmail.com
>> >> > wrote:
>> >>
>> >>>  Il 12/01/2015 17:08, Paul Boldijar ha scritto:
>> >>>
>> >>> Hey, here you go, the metadata
>> >>>
>> >>>
>> >>> Hi Paul, it seems to work fine.
>> >>> Can you provide a snipped code reporting your issue. Please, include
>> >>> imports.
>> >>>
>> >>> Please, check into your imports to be sure to include from v4
>> >package
>> >>> only (v3 package shouldn't appear).
>> >>> Pay attention to EdmEnabledODataClient. See below an example
>> >>>
>> >>> Best regards,
>> >>> F.
>> >>>
>> >>> package net.tirasa.test.olingoproxysample;
>> >>>
>> >>> import
>> >>> net.tirasa.olingoproxysample.net.azurewebsites.odatae2etest.Service;
>> >>> import
>> >>>
>>
>> >net.tirasa.olingoproxysample.net.azurewebsites.odatae2etest.entitysets.Container;
>> >>> import
>> >>>
>>
>> >net.tirasa.olingoproxysample.net.azurewebsites.odatae2etest.vas.model.types.MaterialCollection;
>> >>> import
>> >>>
>>
>> >net.tirasa.olingoproxysample.net.azurewebsites.odatae2etest.vas.model.types.MedicationCollection;
>> >>> import org.apache.olingo.client.api.v4.EdmEnabledODataClient;
>> >>> import org.apache.olingo.commons.api.format.ContentType;
>> >>>
>> >>> public class Main {
>> >>>
>> >>>     public static void main(final String[] args) {
>> >>>         final Service<EdmEnabledODataClient> service =
>> >Service.getV4(
>> >>> "http://www.tirasa.net/olingo/services"
>> >>> <http://www.tirasa.net/olingo/services>);
>> >>>
>> >>>
>>
>> >service.getClient().getConfiguration().setDefaultBatchAcceptFormat(ContentType.APPLICATION_OCTET_STREAM);
>> >>>         final Container container =
>> >>> service.getEntityContainer(Container.class);
>> >>>
>> >>>         final MaterialCollection materials =
>> >>> container.getMaterials().execute();
>> >>>         final MedicationCollection medication =
>> >>> container.getMaterials().execute(MedicationCollection.class);
>> >>>
>> >>>
>> >>>     }
>> >>> }
>> >>>
>> >>>
>> >>> On Mon, Jan 12, 2015 at 3:37 PM, Fabio Martelli
>> ><fabio.martelli@gmail.com
>> >>> > wrote:
>> >>>
>> >>>>  Il 12/01/2015 14:33, Alex Maiereanu ha scritto:
>> >>>>
>> >>>>  Hello Fabio,
>> >>>>
>> >>>>  I know that you are doing this in your spare time. Maybe we can
>> >also
>> >>>> help you with some of the bug fixing stuff, but since we don't know
>> >the
>> >>>> piping we depend on your knowledge :)
>> >>>>
>> >>>>  We are generating from a V4 Service using ASP.net Web Api.
>> >>>> Medication and Materials are from the same Odata service, same
>> >container.
>> >>>>
>> >>>>  Hi Alex, it seems to be a bug in proxy class generation.
>> >>>> Can you attach your metadata (preferred option) or something to
>> >help me
>> >>>> to reproduce the problem?
>> >>>>
>> >>>> Kind regards,
>> >>>>
>> >>>> F.
>> >>>>
>> >>>>
>> >>>>   Salutari din Brasov /  Greetings from Brasov
>> >>>>
>> >>>> Alex-Paul Maiereanu
>> >>>>
>> >>>> +40 761 684 212 <%2B40%20761%20684%20212>
>> >>>>
>> >>>> www.3sstudio.com
>> >>>>
>> >>>> Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
>> >>>> <https://twitter.com/SmartSocialSoft> Google+
>> >>>> <https://plus.google.com/101299629750815349588/posts>
>> >>>>
>> >>>> On Mon, Jan 12, 2015 at 3:24 PM, Fabio Martelli <
>> >>>> fabio.martelli@gmail.com> wrote:
>> >>>>
>> >>>>>  Il 12/01/2015 13:44, Alex Maiereanu ha scritto:
>> >>>>>
>> >>>>> Hello again,
>> >>>>>
>> >>>>>  So, could somebody from the Olingo team tell me if the Proxy
>> >classes
>> >>>>> for Olingo are actually maintained? We can't get any support
>> >regarding this
>> >>>>> part of the technologie. Should we start moving our code to the
>> >common
>> >>>>> factory classes?
>> >>>>>
>> >>>>>  Hi Alex, Proxy classes are maintained by me and someone else in
>> >best
>> >>>>> effort during spare time.
>> >>>>> I can try to give you my help about your last request but I need
>> >to
>> >>>>> understand your case better.
>> >>>>>
>> >>>>> 1. are you generating the proxy from a an OData v3 service?
>> >>>>> 2. Medication and Materials are entity of the same OData service?
>> >Same
>> >>>>> container?
>> >>>>>
>> >>>>> Please, consider that the same proxy (v3 or v4) has to be
>> >generated
>> >>>>> from the same service.
>> >>>>> If this doesn't happen, a bug or configuration problem is
>> >occurring.
>> >>>>>
>> >>>>> Please, let me know.
>> >>>>> Best regards,
>> >>>>> F.
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>>   Salutari din Brasov /  Greetings from Brasov
>> >>>>>
>> >>>>> Alex-Paul Maiereanu
>> >>>>>
>> >>>>> +40 761 684 212 <%2B40%20761%20684%20212> <%2B40%20761%20684%20212>
>> >>>>>
>> >>>>> www.3sstudio.com
>> >>>>>
>> >>>>> Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
>> >>>>> <https://twitter.com/SmartSocialSoft> Google+
>> >>>>> <https://plus.google.com/101299629750815349588/posts>
>> >>>>>
>> >>>>> On Thu, Jan 8, 2015 at 5:33 PM, Alex Maiereanu <
>> >>>>> alex.maiereanu@3sstudio.com> wrote:
>> >>>>>
>> >>>>>> Hello everybody,
>> >>>>>>
>> >>>>>>  To add some more information. Paul is using the Client Proxy
>> >>>>>> classes. The problem is that when the proxies are generated from
>> >the
>> >>>>>> container. The instances classes are dynamically generated.
>> >>>>>>
>> >>>>>>  So for a material entity we have a Proxy3 instance type.
>> >>>>>> Medication Entity, that is derived from Material. will be
>> >generated as
>> >>>>>> Proxy4.
>> >>>>>>
>> >>>>>>  This names we get if we run method getClass().
>> >>>>>>
>> >>>>>>  Our problem is that, if we have a list of Materials, and
>> >afterwards
>> >>>>>> we want to cast this Material to a Medication, the instance type
>> >will be of
>> >>>>>> Proxy3 and not Proxy4, so we cant figure out if the material is a
>> >material
>> >>>>>> or a medication.
>> >>>>>>
>> >>>>>>
>> >>>>>>   Salutari din Brasov /  Greetings from Brasov
>> >>>>>>
>> >>>>>> Alex-Paul Maiereanu
>> >>>>>>
>> >>>>>> +40 761 684 212 <%2B40%20761%20684%20212>
>> <%2B40%20761%20684%20212>
>> >>>>>>
>> >>>>>> www.3sstudio.com
>> >>>>>>
>> >>>>>> Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
>> >>>>>> <https://twitter.com/SmartSocialSoft> Google+
>> >>>>>> <https://plus.google.com/101299629750815349588/posts>
>> >>>>>>
>> >>>>>> On Wed, Jan 7, 2015 at 4:27 PM, Paul Boldijar <
>> >>>>>> paul.boldijar@3sstudio.com> wrote:
>> >>>>>>
>> >>>>>>> Hello!
>> >>>>>>> I'm using Olingo V4 with android.
>> >>>>>>>
>> >>>>>>>  I have a base entity A, and some derrived classes, such as
>> >entity
>> >>>>>>> B, and C.
>> >>>>>>>
>> >>>>>>>  If I want to get all A entities from another entity, the class
>> >of
>> >>>>>>> the java object is always A, even if the object is a B entity.
>> >>>>>>>
>> >>>>>>>  The wierd thing is that if I load all the A entities from the
>> >>>>>>> container, everything is ok, the type of the java objects are
>> >the right
>> >>>>>>> ones.
>> >>>>>>>
>> >>>>>>>  And also, can I get from an odata entity to a
>> >'EntityInvocationHandler'
>> >>>>>>> object?
>> >>>>>>>
>> >>>>>>>  Thank you.
>> >>>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>
>> >>>>>
>> >>>>>   --
>> >>>>> Fabio Martelli
>> >>>>>
>> >>>>> Tirasa - Open Source Excellencehttp://www.tirasa.net/
>> >>>>>
>> >>>>> Apache Syncope PMChttp://people.apache.org/~fmartelli/
>> <http://people.apache.org/%7Efmartelli/>
>> >>>>>
>> >>>>>
>> >>>>
>> >>>>
>> >>>> --
>> >>>> Fabio Martelli
>> >>>>
>> >>>> Tirasa - Open Source Excellencehttp://www.tirasa.net/
>> >>>>
>> >>>> Apache Syncope PMChttp://people.apache.org/~fmartelli/
>> <http://people.apache.org/%7Efmartelli/>
>> >>>>
>> >>>>
>> >>>
>> >>>
>> >>> --
>> >>> Fabio Martelli
>> >>>
>> >>> Tirasa - Open Source Excellencehttp://www.tirasa.net/
>> >>>
>> >>> Apache Syncope PMChttp://people.apache.org/~fmartelli/
>> <http://people.apache.org/%7Efmartelli/>
>> >>>
>> >>>
>> >>
>>
>> -- Inviato dal mio cellulare Android con K-9 Mail.
>>
>
>
> --
> Fabio Martelli
>
> Tirasa - Open Source Excellencehttp://www.tirasa.net/
>
> Apache Syncope PMChttp://people.apache.org/~fmartelli/
>
>
>
> --
> Fabio Martelli
>
> Tirasa - Open Source Excellencehttp://www.tirasa.net/
>
> Apache Syncope PMChttp://people.apache.org/~fmartelli/
>
>

Re: Problem with Olingo V4

Posted by Fabio Martelli <fa...@gmail.com>.
Hi Alex, do you have any update about this topic.

Kind regards,
F.

Il 22/01/2015 22:46, Fabio Martelli ha scritto:
> Il 22/01/2015 17:57, Alex Maiereanu ha scritto:
>>
>> Thank you Fabio for the pointers.  We will  try to make due :)
>>
> Hi Alex, try with
>
> Proxy.getInvocationHandler(proxyinstance)
>
> to get underlying type of the proxy object.
>
> Kind regards,
> F.
>
>> On Jan 22, 2015 5:58 PM, "Fabio Martelli" <fabio.martelli@gmail.com 
>> <ma...@gmail.com>> wrote:
>>
>>     Hi Alex, sorry but not yet. I will try to take a look at it
>>     during next week.
>>
>>     In the meanwhile, take a look below for some comments.
>>
>>     Kind regards,
>>     F.
>>
>>     Il 22 gennaio 2015 16:31:00 CET, Alex Maiereanu
>>     <alex.maiereanu@3sstudio.com
>>     <ma...@3sstudio.com>> ha scritto:
>>     >Hello Fabio,
>>     >
>>     >Did you had time to have a look over the issue?
>>     >
>>     > Salutari din Brasov /  Greetings from Brasov
>>     >
>>     >Alex-Paul Maiereanu
>>     >
>>     >+40 761 684 212 <tel:%2B40%20761%20684%20212>
>>     >
>>     >www.3sstudio.com <http://www.3sstudio.com>
>>     >
>>     >Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
>>     ><https://twitter.com/SmartSocialSoft> Google+
>>     ><https://plus.google.com/101299629750815349588/posts>
>>     >
>>     >On Thu, Jan 15, 2015 at 3:00 PM, Paul Boldijar
>>     ><paul.boldijar@3sstudio.com <ma...@3sstudio.com>>
>>     >wrote:
>>     >
>>     >> Ok here is the exact problem.
>>     >> A client has a deposit, which has a collection of stocks. A
>>     stock has
>>     >a
>>     >> field for material.
>>     >>
>>     >>
>>     >> client.expand("Deposit").load();
>>     What is the purpose of this request?
>>
>>     >>             Deposit clientDeposit = client.getDeposit();
>>     >>             Integer id = clientDeposit.getId();
>>     >>             StockCollection clientStocks =
>>     >> clientDeposit.getStocks().expand("Material").execute();
>>     >>             // a stock has a Material field
>>     >>             for (Stock stock : clientStocks) {
>>     >>                 Material material = stock.getMaterial();
>>     >>                 // here , the materials don't have the derived
>>     class
>>     >type,
>>     >> if this Material is on the server a instance of Vaccine (which is
>>     >derrived
>>     >> from Material),
>>     This is normal: you asked for material
>>     Try with
>>
>>     .execute(Vaccine.class)
>>
>>     This is used to filter on types.
>>
>>     >>                 // material instanceof Vaccine will always return
>>     >false
>>     >>                 // and material.getClass.getName() will always be
>>     >$Proxy3
>>
>>     This will always return a proxy instance: each returned object is
>>     a proxies object.
>>     You can retrieve the real proxied instance type when ever you
>>     want. Please search in the web; if you won't find the solution,
>>     please let me know, I can provide the solution.
>>
>>     >>
>>     >>             }
>>     >>
>>     >> The imports are ok
>>     >> import com.studio3s.vetandroid.veterinarian.Model.Odata.Service;
>>     >> import
>>     >>
>>     >com.studio3s.vetandroid.veterinarian.Model.Odata.entitysets.Container;
>>     >>
>>     >> import org.apache.olingo.client.api.v4.EdmEnabledODataClient;
>>     >> import
>>     >org.apache.olingo.client.core.android.http.AndroidHttpClientFactory;
>>     >>
>>     >> And i'm loading the container like this
>>     >>   mService = Service.getV4("the ip);
>>     >>
>>     >mService.getClient().getConfiguration().setHttpClientFactory(new
>>     >> AndroidHttpClientFactory());
>>     >>         mContainer = mService.getEntityContainer(Container.class);
>>     >>
>>     >>
>>     >> Thanks.
>>     >>
>>     >>
>>     >> On Tue, Jan 13, 2015 at 10:48 AM, Fabio Martelli
>>     ><fabio.martelli@gmail.com <ma...@gmail.com>
>>     >> > wrote:
>>     >>
>>     >>>  Il 12/01/2015 17:08, Paul Boldijar ha scritto:
>>     >>>
>>     >>> Hey, here you go, the metadata
>>     >>>
>>     >>>
>>     >>> Hi Paul, it seems to work fine.
>>     >>> Can you provide a snipped code reporting your issue. Please,
>>     include
>>     >>> imports.
>>     >>>
>>     >>> Please, check into your imports to be sure to include from v4
>>     >package
>>     >>> only (v3 package shouldn't appear).
>>     >>> Pay attention to EdmEnabledODataClient. See below an example
>>     >>>
>>     >>> Best regards,
>>     >>> F.
>>     >>>
>>     >>> package net.tirasa.test.olingoproxysample;
>>     >>>
>>     >>> import
>>     >>>
>>     net.tirasa.olingoproxysample.net.azurewebsites.odatae2etest.Service;
>>     >>> import
>>     >>>
>>     >net.tirasa.olingoproxysample.net.azurewebsites.odatae2etest.entitysets.Container;
>>     >>> import
>>     >>>
>>     >net.tirasa.olingoproxysample.net.azurewebsites.odatae2etest.vas.model.types.MaterialCollection;
>>     >>> import
>>     >>>
>>     >net.tirasa.olingoproxysample.net.azurewebsites.odatae2etest.vas.model.types.MedicationCollection;
>>     >>> import org.apache.olingo.client.api.v4.EdmEnabledODataClient;
>>     >>> import org.apache.olingo.commons.api.format.ContentType;
>>     >>>
>>     >>> public class Main {
>>     >>>
>>     >>>     public static void main(final String[] args) {
>>     >>>         final Service<EdmEnabledODataClient> service =
>>     >Service.getV4(
>>     >>> "http://www.tirasa.net/olingo/services"
>>     >>> <http://www.tirasa.net/olingo/services>);
>>     >>>
>>     >>>
>>     >service.getClient().getConfiguration().setDefaultBatchAcceptFormat(ContentType.APPLICATION_OCTET_STREAM);
>>     >>>         final Container container =
>>     >>> service.getEntityContainer(Container.class);
>>     >>>
>>     >>>         final MaterialCollection materials =
>>     >>> container.getMaterials().execute();
>>     >>>         final MedicationCollection medication =
>>     >>> container.getMaterials().execute(MedicationCollection.class);
>>     >>>
>>     >>>
>>     >>>     }
>>     >>> }
>>     >>>
>>     >>>
>>     >>> On Mon, Jan 12, 2015 at 3:37 PM, Fabio Martelli
>>     ><fabio.martelli@gmail.com <ma...@gmail.com>
>>     >>> > wrote:
>>     >>>
>>     >>>>  Il 12/01/2015 14:33, Alex Maiereanu ha scritto:
>>     >>>>
>>     >>>>  Hello Fabio,
>>     >>>>
>>     >>>>  I know that you are doing this in your spare time. Maybe we can
>>     >also
>>     >>>> help you with some of the bug fixing stuff, but since we
>>     don't know
>>     >the
>>     >>>> piping we depend on your knowledge :)
>>     >>>>
>>     >>>>  We are generating from a V4 Service using ASP.net Web Api.
>>     >>>> Medication and Materials are from the same Odata service, same
>>     >container.
>>     >>>>
>>     >>>>  Hi Alex, it seems to be a bug in proxy class generation.
>>     >>>> Can you attach your metadata (preferred option) or something to
>>     >help me
>>     >>>> to reproduce the problem?
>>     >>>>
>>     >>>> Kind regards,
>>     >>>>
>>     >>>> F.
>>     >>>>
>>     >>>>
>>     >>>>   Salutari din Brasov /  Greetings from Brasov
>>     >>>>
>>     >>>> Alex-Paul Maiereanu
>>     >>>>
>>     >>>> +40 761 684 212 <tel:%2B40%20761%20684%20212>
>>     >>>>
>>     >>>> www.3sstudio.com <http://www.3sstudio.com>
>>     >>>>
>>     >>>> Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
>>     >>>> <https://twitter.com/SmartSocialSoft> Google+
>>     >>>> <https://plus.google.com/101299629750815349588/posts>
>>     >>>>
>>     >>>> On Mon, Jan 12, 2015 at 3:24 PM, Fabio Martelli <
>>     >>>> fabio.martelli@gmail.com <ma...@gmail.com>>
>>     wrote:
>>     >>>>
>>     >>>>>  Il 12/01/2015 13:44, Alex Maiereanu ha scritto:
>>     >>>>>
>>     >>>>> Hello again,
>>     >>>>>
>>     >>>>>  So, could somebody from the Olingo team tell me if the Proxy
>>     >classes
>>     >>>>> for Olingo are actually maintained? We can't get any support
>>     >regarding this
>>     >>>>> part of the technologie. Should we start moving our code to the
>>     >common
>>     >>>>> factory classes?
>>     >>>>>
>>     >>>>>  Hi Alex, Proxy classes are maintained by me and someone
>>     else in
>>     >best
>>     >>>>> effort during spare time.
>>     >>>>> I can try to give you my help about your last request but I
>>     need
>>     >to
>>     >>>>> understand your case better.
>>     >>>>>
>>     >>>>> 1. are you generating the proxy from a an OData v3 service?
>>     >>>>> 2. Medication and Materials are entity of the same OData
>>     service?
>>     >Same
>>     >>>>> container?
>>     >>>>>
>>     >>>>> Please, consider that the same proxy (v3 or v4) has to be
>>     >generated
>>     >>>>> from the same service.
>>     >>>>> If this doesn't happen, a bug or configuration problem is
>>     >occurring.
>>     >>>>>
>>     >>>>> Please, let me know.
>>     >>>>> Best regards,
>>     >>>>> F.
>>     >>>>>
>>     >>>>>
>>     >>>>>
>>     >>>>>   Salutari din Brasov /  Greetings from Brasov
>>     >>>>>
>>     >>>>> Alex-Paul Maiereanu
>>     >>>>>
>>     >>>>> +40 761 684 212 <tel:%2B40%20761%20684%20212>
>>     <%2B40%20761%20684%20212>
>>     >>>>>
>>     >>>>> www.3sstudio.com <http://www.3sstudio.com>
>>     >>>>>
>>     >>>>> Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
>>     >>>>> <https://twitter.com/SmartSocialSoft> Google+
>>     >>>>> <https://plus.google.com/101299629750815349588/posts>
>>     >>>>>
>>     >>>>> On Thu, Jan 8, 2015 at 5:33 PM, Alex Maiereanu <
>>     >>>>> alex.maiereanu@3sstudio.com
>>     <ma...@3sstudio.com>> wrote:
>>     >>>>>
>>     >>>>>> Hello everybody,
>>     >>>>>>
>>     >>>>>>  To add some more information. Paul is using the Client Proxy
>>     >>>>>> classes. The problem is that when the proxies are
>>     generated from
>>     >the
>>     >>>>>> container. The instances classes are dynamically generated.
>>     >>>>>>
>>     >>>>>>  So for a material entity we have a Proxy3 instance type.
>>     >>>>>> Medication Entity, that is derived from Material. will be
>>     >generated as
>>     >>>>>> Proxy4.
>>     >>>>>>
>>     >>>>>>  This names we get if we run method getClass().
>>     >>>>>>
>>     >>>>>>  Our problem is that, if we have a list of Materials, and
>>     >afterwards
>>     >>>>>> we want to cast this Material to a Medication, the
>>     instance type
>>     >will be of
>>     >>>>>> Proxy3 and not Proxy4, so we cant figure out if the
>>     material is a
>>     >material
>>     >>>>>> or a medication.
>>     >>>>>>
>>     >>>>>>
>>     >>>>>>   Salutari din Brasov /  Greetings from Brasov
>>     >>>>>>
>>     >>>>>> Alex-Paul Maiereanu
>>     >>>>>>
>>     >>>>>> +40 761 684 212 <tel:%2B40%20761%20684%20212>
>>     <%2B40%20761%20684%20212>
>>     >>>>>>
>>     >>>>>> www.3sstudio.com <http://www.3sstudio.com>
>>     >>>>>>
>>     >>>>>> Facebook <https://www.facebook.com/smartsocialsoftware>
>>     Twitter
>>     >>>>>> <https://twitter.com/SmartSocialSoft> Google+
>>     >>>>>> <https://plus.google.com/101299629750815349588/posts>
>>     >>>>>>
>>     >>>>>> On Wed, Jan 7, 2015 at 4:27 PM, Paul Boldijar <
>>     >>>>>> paul.boldijar@3sstudio.com
>>     <ma...@3sstudio.com>> wrote:
>>     >>>>>>
>>     >>>>>>> Hello!
>>     >>>>>>> I'm using Olingo V4 with android.
>>     >>>>>>>
>>     >>>>>>>  I have a base entity A, and some derrived classes, such as
>>     >entity
>>     >>>>>>> B, and C.
>>     >>>>>>>
>>     >>>>>>>  If I want to get all A entities from another entity, the
>>     class
>>     >of
>>     >>>>>>> the java object is always A, even if the object is a B
>>     entity.
>>     >>>>>>>
>>     >>>>>>>  The wierd thing is that if I load all the A entities
>>     from the
>>     >>>>>>> container, everything is ok, the type of the java objects are
>>     >the right
>>     >>>>>>> ones.
>>     >>>>>>>
>>     >>>>>>>  And also, can I get from an odata entity to a
>>     >'EntityInvocationHandler'
>>     >>>>>>> object?
>>     >>>>>>>
>>     >>>>>>>  Thank you.
>>     >>>>>>>
>>     >>>>>>
>>     >>>>>>
>>     >>>>>
>>     >>>>>
>>     >>>>>   --
>>     >>>>> Fabio Martelli
>>     >>>>>
>>     >>>>> Tirasa - Open Source Excellencehttp://www.tirasa.net/
>>     <http://www.tirasa.net/>
>>     >>>>>
>>     >>>>> Apache Syncope PMChttp://people.apache.org/~fmartelli/
>>     <http://people.apache.org/%7Efmartelli/>
>>     >>>>>
>>     >>>>>
>>     >>>>
>>     >>>>
>>     >>>> --
>>     >>>> Fabio Martelli
>>     >>>>
>>     >>>> Tirasa - Open Source Excellencehttp://www.tirasa.net/
>>     <http://www.tirasa.net/>
>>     >>>>
>>     >>>> Apache Syncope PMChttp://people.apache.org/~fmartelli/
>>     <http://people.apache.org/%7Efmartelli/>
>>     >>>>
>>     >>>>
>>     >>>
>>     >>>
>>     >>> --
>>     >>> Fabio Martelli
>>     >>>
>>     >>> Tirasa - Open Source Excellencehttp://www.tirasa.net/
>>     <http://www.tirasa.net/>
>>     >>>
>>     >>> Apache Syncope PMChttp://people.apache.org/~fmartelli/
>>     <http://people.apache.org/%7Efmartelli/>
>>     >>>
>>     >>>
>>     >>
>>
>>     -- Inviato dal mio cellulare Android con K-9 Mail.
>>
>
>
> -- 
> Fabio Martelli
>
> Tirasa - Open Source Excellence
> http://www.tirasa.net/
>
> Apache Syncope PMC
> http://people.apache.org/~fmartelli/


-- 
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>.
Il 22/01/2015 17:57, Alex Maiereanu ha scritto:
>
> Thank you Fabio for the pointers.  We will  try to make due :)
>
Hi Alex, try with

Proxy.getInvocationHandler(proxyinstance)

to get underlying type of the proxy object.

Kind regards,
F.

> On Jan 22, 2015 5:58 PM, "Fabio Martelli" <fabio.martelli@gmail.com 
> <ma...@gmail.com>> wrote:
>
>     Hi Alex, sorry but not yet. I will try to take a look at it during
>     next week.
>
>     In the meanwhile, take a look below for some comments.
>
>     Kind regards,
>     F.
>
>     Il 22 gennaio 2015 16:31:00 CET, Alex Maiereanu
>     <alex.maiereanu@3sstudio.com <ma...@3sstudio.com>>
>     ha scritto:
>     >Hello Fabio,
>     >
>     >Did you had time to have a look over the issue?
>     >
>     > Salutari din Brasov /  Greetings from Brasov
>     >
>     >Alex-Paul Maiereanu
>     >
>     >+40 761 684 212 <tel:%2B40%20761%20684%20212>
>     >
>     >www.3sstudio.com <http://www.3sstudio.com>
>     >
>     >Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
>     ><https://twitter.com/SmartSocialSoft> Google+
>     ><https://plus.google.com/101299629750815349588/posts>
>     >
>     >On Thu, Jan 15, 2015 at 3:00 PM, Paul Boldijar
>     ><paul.boldijar@3sstudio.com <ma...@3sstudio.com>>
>     >wrote:
>     >
>     >> Ok here is the exact problem.
>     >> A client has a deposit, which has a collection of stocks. A
>     stock has
>     >a
>     >> field for material.
>     >>
>     >>
>     >> client.expand("Deposit").load();
>     What is the purpose of this request?
>
>     >>             Deposit clientDeposit = client.getDeposit();
>     >>             Integer id = clientDeposit.getId();
>     >>             StockCollection clientStocks =
>     >> clientDeposit.getStocks().expand("Material").execute();
>     >>             // a stock has a Material field
>     >>             for (Stock stock : clientStocks) {
>     >>                 Material material = stock.getMaterial();
>     >>                 // here , the materials don't have the derived
>     class
>     >type,
>     >> if this Material is on the server a instance of Vaccine (which is
>     >derrived
>     >> from Material),
>     This is normal: you asked for material
>     Try with
>
>     .execute(Vaccine.class)
>
>     This is used to filter on types.
>
>     >>                 // material instanceof Vaccine will always return
>     >false
>     >>                 // and material.getClass.getName() will always be
>     >$Proxy3
>
>     This will always return a proxy instance: each returned object is
>     a proxies object.
>     You can retrieve the real proxied instance type when ever you
>     want. Please search in the web; if you won't find the solution,
>     please let me know, I can provide the solution.
>
>     >>
>     >>             }
>     >>
>     >> The imports are ok
>     >> import com.studio3s.vetandroid.veterinarian.Model.Odata.Service;
>     >> import
>     >>
>     >com.studio3s.vetandroid.veterinarian.Model.Odata.entitysets.Container;
>     >>
>     >> import org.apache.olingo.client.api.v4.EdmEnabledODataClient;
>     >> import
>     >org.apache.olingo.client.core.android.http.AndroidHttpClientFactory;
>     >>
>     >> And i'm loading the container like this
>     >>   mService = Service.getV4("the ip);
>     >>
>     >mService.getClient().getConfiguration().setHttpClientFactory(new
>     >> AndroidHttpClientFactory());
>     >>         mContainer = mService.getEntityContainer(Container.class);
>     >>
>     >>
>     >> Thanks.
>     >>
>     >>
>     >> On Tue, Jan 13, 2015 at 10:48 AM, Fabio Martelli
>     ><fabio.martelli@gmail.com <ma...@gmail.com>
>     >> > wrote:
>     >>
>     >>>  Il 12/01/2015 17:08, Paul Boldijar ha scritto:
>     >>>
>     >>> Hey, here you go, the metadata
>     >>>
>     >>>
>     >>> Hi Paul, it seems to work fine.
>     >>> Can you provide a snipped code reporting your issue. Please,
>     include
>     >>> imports.
>     >>>
>     >>> Please, check into your imports to be sure to include from v4
>     >package
>     >>> only (v3 package shouldn't appear).
>     >>> Pay attention to EdmEnabledODataClient. See below an example
>     >>>
>     >>> Best regards,
>     >>> F.
>     >>>
>     >>> package net.tirasa.test.olingoproxysample;
>     >>>
>     >>> import
>     >>>
>     net.tirasa.olingoproxysample.net.azurewebsites.odatae2etest.Service;
>     >>> import
>     >>>
>     >net.tirasa.olingoproxysample.net.azurewebsites.odatae2etest.entitysets.Container;
>     >>> import
>     >>>
>     >net.tirasa.olingoproxysample.net.azurewebsites.odatae2etest.vas.model.types.MaterialCollection;
>     >>> import
>     >>>
>     >net.tirasa.olingoproxysample.net.azurewebsites.odatae2etest.vas.model.types.MedicationCollection;
>     >>> import org.apache.olingo.client.api.v4.EdmEnabledODataClient;
>     >>> import org.apache.olingo.commons.api.format.ContentType;
>     >>>
>     >>> public class Main {
>     >>>
>     >>>     public static void main(final String[] args) {
>     >>>         final Service<EdmEnabledODataClient> service =
>     >Service.getV4(
>     >>> "http://www.tirasa.net/olingo/services"
>     >>> <http://www.tirasa.net/olingo/services>);
>     >>>
>     >>>
>     >service.getClient().getConfiguration().setDefaultBatchAcceptFormat(ContentType.APPLICATION_OCTET_STREAM);
>     >>>         final Container container =
>     >>> service.getEntityContainer(Container.class);
>     >>>
>     >>>         final MaterialCollection materials =
>     >>> container.getMaterials().execute();
>     >>>         final MedicationCollection medication =
>     >>> container.getMaterials().execute(MedicationCollection.class);
>     >>>
>     >>>
>     >>>     }
>     >>> }
>     >>>
>     >>>
>     >>> On Mon, Jan 12, 2015 at 3:37 PM, Fabio Martelli
>     ><fabio.martelli@gmail.com <ma...@gmail.com>
>     >>> > wrote:
>     >>>
>     >>>>  Il 12/01/2015 14:33, Alex Maiereanu ha scritto:
>     >>>>
>     >>>>  Hello Fabio,
>     >>>>
>     >>>>  I know that you are doing this in your spare time. Maybe we can
>     >also
>     >>>> help you with some of the bug fixing stuff, but since we
>     don't know
>     >the
>     >>>> piping we depend on your knowledge :)
>     >>>>
>     >>>>  We are generating from a V4 Service using ASP.net Web Api.
>     >>>> Medication and Materials are from the same Odata service, same
>     >container.
>     >>>>
>     >>>>  Hi Alex, it seems to be a bug in proxy class generation.
>     >>>> Can you attach your metadata (preferred option) or something to
>     >help me
>     >>>> to reproduce the problem?
>     >>>>
>     >>>> Kind regards,
>     >>>>
>     >>>> F.
>     >>>>
>     >>>>
>     >>>>   Salutari din Brasov /  Greetings from Brasov
>     >>>>
>     >>>> Alex-Paul Maiereanu
>     >>>>
>     >>>> +40 761 684 212 <tel:%2B40%20761%20684%20212>
>     >>>>
>     >>>> www.3sstudio.com <http://www.3sstudio.com>
>     >>>>
>     >>>> Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
>     >>>> <https://twitter.com/SmartSocialSoft> Google+
>     >>>> <https://plus.google.com/101299629750815349588/posts>
>     >>>>
>     >>>> On Mon, Jan 12, 2015 at 3:24 PM, Fabio Martelli <
>     >>>> fabio.martelli@gmail.com <ma...@gmail.com>>
>     wrote:
>     >>>>
>     >>>>>  Il 12/01/2015 13:44, Alex Maiereanu ha scritto:
>     >>>>>
>     >>>>> Hello again,
>     >>>>>
>     >>>>>  So, could somebody from the Olingo team tell me if the Proxy
>     >classes
>     >>>>> for Olingo are actually maintained? We can't get any support
>     >regarding this
>     >>>>> part of the technologie. Should we start moving our code to the
>     >common
>     >>>>> factory classes?
>     >>>>>
>     >>>>>  Hi Alex, Proxy classes are maintained by me and someone else in
>     >best
>     >>>>> effort during spare time.
>     >>>>> I can try to give you my help about your last request but I need
>     >to
>     >>>>> understand your case better.
>     >>>>>
>     >>>>> 1. are you generating the proxy from a an OData v3 service?
>     >>>>> 2. Medication and Materials are entity of the same OData
>     service?
>     >Same
>     >>>>> container?
>     >>>>>
>     >>>>> Please, consider that the same proxy (v3 or v4) has to be
>     >generated
>     >>>>> from the same service.
>     >>>>> If this doesn't happen, a bug or configuration problem is
>     >occurring.
>     >>>>>
>     >>>>> Please, let me know.
>     >>>>> Best regards,
>     >>>>> F.
>     >>>>>
>     >>>>>
>     >>>>>
>     >>>>>   Salutari din Brasov /  Greetings from Brasov
>     >>>>>
>     >>>>> Alex-Paul Maiereanu
>     >>>>>
>     >>>>> +40 761 684 212 <tel:%2B40%20761%20684%20212>
>     <%2B40%20761%20684%20212>
>     >>>>>
>     >>>>> www.3sstudio.com <http://www.3sstudio.com>
>     >>>>>
>     >>>>> Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
>     >>>>> <https://twitter.com/SmartSocialSoft> Google+
>     >>>>> <https://plus.google.com/101299629750815349588/posts>
>     >>>>>
>     >>>>> On Thu, Jan 8, 2015 at 5:33 PM, Alex Maiereanu <
>     >>>>> alex.maiereanu@3sstudio.com
>     <ma...@3sstudio.com>> wrote:
>     >>>>>
>     >>>>>> Hello everybody,
>     >>>>>>
>     >>>>>>  To add some more information. Paul is using the Client Proxy
>     >>>>>> classes. The problem is that when the proxies are generated
>     from
>     >the
>     >>>>>> container. The instances classes are dynamically generated.
>     >>>>>>
>     >>>>>>  So for a material entity we have a Proxy3 instance type.
>     >>>>>> Medication Entity, that is derived from Material. will be
>     >generated as
>     >>>>>> Proxy4.
>     >>>>>>
>     >>>>>>  This names we get if we run method getClass().
>     >>>>>>
>     >>>>>>  Our problem is that, if we have a list of Materials, and
>     >afterwards
>     >>>>>> we want to cast this Material to a Medication, the instance
>     type
>     >will be of
>     >>>>>> Proxy3 and not Proxy4, so we cant figure out if the
>     material is a
>     >material
>     >>>>>> or a medication.
>     >>>>>>
>     >>>>>>
>     >>>>>>   Salutari din Brasov /  Greetings from Brasov
>     >>>>>>
>     >>>>>> Alex-Paul Maiereanu
>     >>>>>>
>     >>>>>> +40 761 684 212 <tel:%2B40%20761%20684%20212>
>     <%2B40%20761%20684%20212>
>     >>>>>>
>     >>>>>> www.3sstudio.com <http://www.3sstudio.com>
>     >>>>>>
>     >>>>>> Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
>     >>>>>> <https://twitter.com/SmartSocialSoft> Google+
>     >>>>>> <https://plus.google.com/101299629750815349588/posts>
>     >>>>>>
>     >>>>>> On Wed, Jan 7, 2015 at 4:27 PM, Paul Boldijar <
>     >>>>>> paul.boldijar@3sstudio.com
>     <ma...@3sstudio.com>> wrote:
>     >>>>>>
>     >>>>>>> Hello!
>     >>>>>>> I'm using Olingo V4 with android.
>     >>>>>>>
>     >>>>>>>  I have a base entity A, and some derrived classes, such as
>     >entity
>     >>>>>>> B, and C.
>     >>>>>>>
>     >>>>>>>  If I want to get all A entities from another entity, the
>     class
>     >of
>     >>>>>>> the java object is always A, even if the object is a B entity.
>     >>>>>>>
>     >>>>>>>  The wierd thing is that if I load all the A entities from the
>     >>>>>>> container, everything is ok, the type of the java objects are
>     >the right
>     >>>>>>> ones.
>     >>>>>>>
>     >>>>>>>  And also, can I get from an odata entity to a
>     >'EntityInvocationHandler'
>     >>>>>>> object?
>     >>>>>>>
>     >>>>>>>  Thank you.
>     >>>>>>>
>     >>>>>>
>     >>>>>>
>     >>>>>
>     >>>>>
>     >>>>>   --
>     >>>>> Fabio Martelli
>     >>>>>
>     >>>>> Tirasa - Open Source Excellencehttp://www.tirasa.net/
>     <http://www.tirasa.net/>
>     >>>>>
>     >>>>> Apache Syncope PMChttp://people.apache.org/~fmartelli/
>     <http://people.apache.org/%7Efmartelli/>
>     >>>>>
>     >>>>>
>     >>>>
>     >>>>
>     >>>> --
>     >>>> Fabio Martelli
>     >>>>
>     >>>> Tirasa - Open Source Excellencehttp://www.tirasa.net/
>     <http://www.tirasa.net/>
>     >>>>
>     >>>> Apache Syncope PMChttp://people.apache.org/~fmartelli/
>     <http://people.apache.org/%7Efmartelli/>
>     >>>>
>     >>>>
>     >>>
>     >>>
>     >>> --
>     >>> Fabio Martelli
>     >>>
>     >>> Tirasa - Open Source Excellencehttp://www.tirasa.net/
>     <http://www.tirasa.net/>
>     >>>
>     >>> Apache Syncope PMChttp://people.apache.org/~fmartelli/
>     <http://people.apache.org/%7Efmartelli/>
>     >>>
>     >>>
>     >>
>
>     -- Inviato dal mio cellulare Android con K-9 Mail.
>


-- 
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 Alex, sorry but not yet. I will try to take a look at it during next week.
 
In the meanwhile, take a look below for some comments.

Kind regards,
F.

Il 22 gennaio 2015 16:31:00 CET, Alex Maiereanu <al...@3sstudio.com> ha scritto:
>Hello Fabio,
>
>Did you had time to have a look over the issue?
>
> Salutari din Brasov /  Greetings from Brasov
>
>Alex-Paul Maiereanu
>
>+40 761 684 212
>
>www.3sstudio.com
>
>Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
><https://twitter.com/SmartSocialSoft> Google+
><https://plus.google.com/101299629750815349588/posts>
>
>On Thu, Jan 15, 2015 at 3:00 PM, Paul Boldijar
><pa...@3sstudio.com>
>wrote:
>
>> Ok here is the exact problem.
>> A client has a deposit, which has a collection of stocks. A stock has
>a
>> field for material.
>>
>>
>> client.expand("Deposit").load();
What is the purpose of this request?

>>             Deposit clientDeposit = client.getDeposit();
>>             Integer id = clientDeposit.getId();
>>             StockCollection clientStocks =
>> clientDeposit.getStocks().expand("Material").execute();
>>             // a stock has a Material field
>>             for (Stock stock : clientStocks) {
>>                 Material material = stock.getMaterial();
>>                 // here , the materials don't have the derived class
>type,
>> if this Material is on the server a instance of Vaccine (which is
>derrived
>> from Material),
This is normal: you asked for material
Try with 

.execute(Vaccine.class)

This is used to filter on types.

>>                 // material instanceof Vaccine will always return
>false
>>                 // and material.getClass.getName() will always be
>$Proxy3

This will always return a proxy instance: each returned object is a proxies object.
You can retrieve the real proxied instance type when ever you want. Please search in the web; if you won't find the solution, please let me know, I can provide the solution.

>>
>>             }
>>
>> The imports are ok
>> import com.studio3s.vetandroid.veterinarian.Model.Odata.Service;
>> import
>>
>com.studio3s.vetandroid.veterinarian.Model.Odata.entitysets.Container;
>>
>> import org.apache.olingo.client.api.v4.EdmEnabledODataClient;
>> import
>org.apache.olingo.client.core.android.http.AndroidHttpClientFactory;
>>
>> And i'm loading the container like this
>>   mService = Service.getV4("the ip);
>>        
>mService.getClient().getConfiguration().setHttpClientFactory(new
>> AndroidHttpClientFactory());
>>         mContainer = mService.getEntityContainer(Container.class);
>>
>>
>> Thanks.
>>
>>
>> On Tue, Jan 13, 2015 at 10:48 AM, Fabio Martelli
><fabio.martelli@gmail.com
>> > wrote:
>>
>>>  Il 12/01/2015 17:08, Paul Boldijar ha scritto:
>>>
>>> Hey, here you go, the metadata
>>>
>>>
>>> Hi Paul, it seems to work fine.
>>> Can you provide a snipped code reporting your issue. Please, include
>>> imports.
>>>
>>> Please, check into your imports to be sure to include from v4
>package
>>> only (v3 package shouldn't appear).
>>> Pay attention to EdmEnabledODataClient. See below an example
>>>
>>> Best regards,
>>> F.
>>>
>>> package net.tirasa.test.olingoproxysample;
>>>
>>> import
>>> net.tirasa.olingoproxysample.net.azurewebsites.odatae2etest.Service;
>>> import
>>>
>net.tirasa.olingoproxysample.net.azurewebsites.odatae2etest.entitysets.Container;
>>> import
>>>
>net.tirasa.olingoproxysample.net.azurewebsites.odatae2etest.vas.model.types.MaterialCollection;
>>> import
>>>
>net.tirasa.olingoproxysample.net.azurewebsites.odatae2etest.vas.model.types.MedicationCollection;
>>> import org.apache.olingo.client.api.v4.EdmEnabledODataClient;
>>> import org.apache.olingo.commons.api.format.ContentType;
>>>
>>> public class Main {
>>>
>>>     public static void main(final String[] args) {
>>>         final Service<EdmEnabledODataClient> service =
>Service.getV4(
>>> "http://www.tirasa.net/olingo/services"
>>> <http://www.tirasa.net/olingo/services>);
>>>
>>>
>service.getClient().getConfiguration().setDefaultBatchAcceptFormat(ContentType.APPLICATION_OCTET_STREAM);
>>>         final Container container =
>>> service.getEntityContainer(Container.class);
>>>
>>>         final MaterialCollection materials =
>>> container.getMaterials().execute();
>>>         final MedicationCollection medication =
>>> container.getMaterials().execute(MedicationCollection.class);
>>>
>>>
>>>     }
>>> }
>>>
>>>
>>> On Mon, Jan 12, 2015 at 3:37 PM, Fabio Martelli
><fabio.martelli@gmail.com
>>> > wrote:
>>>
>>>>  Il 12/01/2015 14:33, Alex Maiereanu ha scritto:
>>>>
>>>>  Hello Fabio,
>>>>
>>>>  I know that you are doing this in your spare time. Maybe we can
>also
>>>> help you with some of the bug fixing stuff, but since we don't know
>the
>>>> piping we depend on your knowledge :)
>>>>
>>>>  We are generating from a V4 Service using ASP.net Web Api.
>>>> Medication and Materials are from the same Odata service, same
>container.
>>>>
>>>>  Hi Alex, it seems to be a bug in proxy class generation.
>>>> Can you attach your metadata (preferred option) or something to
>help me
>>>> to reproduce the problem?
>>>>
>>>> Kind regards,
>>>>
>>>> F.
>>>>
>>>>
>>>>   Salutari din Brasov /  Greetings from Brasov
>>>>
>>>> Alex-Paul Maiereanu
>>>>
>>>> +40 761 684 212
>>>>
>>>> www.3sstudio.com
>>>>
>>>> Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
>>>> <https://twitter.com/SmartSocialSoft> Google+
>>>> <https://plus.google.com/101299629750815349588/posts>
>>>>
>>>> On Mon, Jan 12, 2015 at 3:24 PM, Fabio Martelli <
>>>> fabio.martelli@gmail.com> wrote:
>>>>
>>>>>  Il 12/01/2015 13:44, Alex Maiereanu ha scritto:
>>>>>
>>>>> Hello again,
>>>>>
>>>>>  So, could somebody from the Olingo team tell me if the Proxy
>classes
>>>>> for Olingo are actually maintained? We can't get any support
>regarding this
>>>>> part of the technologie. Should we start moving our code to the
>common
>>>>> factory classes?
>>>>>
>>>>>  Hi Alex, Proxy classes are maintained by me and someone else in
>best
>>>>> effort during spare time.
>>>>> I can try to give you my help about your last request but I need
>to
>>>>> understand your case better.
>>>>>
>>>>> 1. are you generating the proxy from a an OData v3 service?
>>>>> 2. Medication and Materials are entity of the same OData service?
>Same
>>>>> container?
>>>>>
>>>>> Please, consider that the same proxy (v3 or v4) has to be
>generated
>>>>> from the same service.
>>>>> If this doesn't happen, a bug or configuration problem is
>occurring.
>>>>>
>>>>> Please, let me know.
>>>>> Best regards,
>>>>> F.
>>>>>
>>>>>
>>>>>
>>>>>   Salutari din Brasov /  Greetings from Brasov
>>>>>
>>>>> Alex-Paul Maiereanu
>>>>>
>>>>> +40 761 684 212 <%2B40%20761%20684%20212>
>>>>>
>>>>> www.3sstudio.com
>>>>>
>>>>> Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
>>>>> <https://twitter.com/SmartSocialSoft> Google+
>>>>> <https://plus.google.com/101299629750815349588/posts>
>>>>>
>>>>> On Thu, Jan 8, 2015 at 5:33 PM, Alex Maiereanu <
>>>>> alex.maiereanu@3sstudio.com> wrote:
>>>>>
>>>>>> Hello everybody,
>>>>>>
>>>>>>  To add some more information. Paul is using the Client Proxy
>>>>>> classes. The problem is that when the proxies are generated from
>the
>>>>>> container. The instances classes are dynamically generated.
>>>>>>
>>>>>>  So for a material entity we have a Proxy3 instance type.
>>>>>> Medication Entity, that is derived from Material. will be
>generated as
>>>>>> Proxy4.
>>>>>>
>>>>>>  This names we get if we run method getClass().
>>>>>>
>>>>>>  Our problem is that, if we have a list of Materials, and
>afterwards
>>>>>> we want to cast this Material to a Medication, the instance type
>will be of
>>>>>> Proxy3 and not Proxy4, so we cant figure out if the material is a
>material
>>>>>> or a medication.
>>>>>>
>>>>>>
>>>>>>   Salutari din Brasov /  Greetings from Brasov
>>>>>>
>>>>>> Alex-Paul Maiereanu
>>>>>>
>>>>>> +40 761 684 212 <%2B40%20761%20684%20212>
>>>>>>
>>>>>> www.3sstudio.com
>>>>>>
>>>>>> Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
>>>>>> <https://twitter.com/SmartSocialSoft> Google+
>>>>>> <https://plus.google.com/101299629750815349588/posts>
>>>>>>
>>>>>> On Wed, Jan 7, 2015 at 4:27 PM, Paul Boldijar <
>>>>>> paul.boldijar@3sstudio.com> wrote:
>>>>>>
>>>>>>> Hello!
>>>>>>> I'm using Olingo V4 with android.
>>>>>>>
>>>>>>>  I have a base entity A, and some derrived classes, such as
>entity
>>>>>>> B, and C.
>>>>>>>
>>>>>>>  If I want to get all A entities from another entity, the class
>of
>>>>>>> the java object is always A, even if the object is a B entity.
>>>>>>>
>>>>>>>  The wierd thing is that if I load all the A entities from the
>>>>>>> container, everything is ok, the type of the java objects are
>the right
>>>>>>> ones.
>>>>>>>
>>>>>>>  And also, can I get from an odata entity to a
>'EntityInvocationHandler'
>>>>>>> object?
>>>>>>>
>>>>>>>  Thank you.
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>   --
>>>>> Fabio Martelli
>>>>>
>>>>> Tirasa - Open Source Excellencehttp://www.tirasa.net/
>>>>>
>>>>> Apache Syncope PMChttp://people.apache.org/~fmartelli/
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Fabio Martelli
>>>>
>>>> Tirasa - Open Source Excellencehttp://www.tirasa.net/
>>>>
>>>> Apache Syncope PMChttp://people.apache.org/~fmartelli/
>>>>
>>>>
>>>
>>>
>>> --
>>> Fabio Martelli
>>>
>>> Tirasa - Open Source Excellencehttp://www.tirasa.net/
>>>
>>> Apache Syncope PMChttp://people.apache.org/~fmartelli/
>>>
>>>
>>

-- Inviato dal mio cellulare Android con K-9 Mail.

Re: Problem with Olingo V4

Posted by Alex Maiereanu <al...@3sstudio.com>.
Hello Fabio,

Did you had time to have a look over the issue?

 Salutari din Brasov /  Greetings from Brasov

Alex-Paul Maiereanu

+40 761 684 212

www.3sstudio.com

Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
<https://twitter.com/SmartSocialSoft> Google+
<https://plus.google.com/101299629750815349588/posts>

On Thu, Jan 15, 2015 at 3:00 PM, Paul Boldijar <pa...@3sstudio.com>
wrote:

> Ok here is the exact problem.
> A client has a deposit, which has a collection of stocks. A stock has a
> field for material.
>
>
> client.expand("Deposit").load();
>             Deposit clientDeposit = client.getDeposit();
>             Integer id = clientDeposit.getId();
>             StockCollection clientStocks =
> clientDeposit.getStocks().expand("Material").execute();
>             // a stock has a Material field
>             for (Stock stock : clientStocks) {
>                 Material material = stock.getMaterial();
>                 // here , the materials don't have the derived class type,
> if this Material is on the server a instance of Vaccine (which is derrived
> from Material),
>                 // material instanceof Vaccine will always return false
>                 // and material.getClass.getName() will always be $Proxy31
>
>             }
>
> The imports are ok
> import com.studio3s.vetandroid.veterinarian.Model.Odata.Service;
> import
> com.studio3s.vetandroid.veterinarian.Model.Odata.entitysets.Container;
>
> import org.apache.olingo.client.api.v4.EdmEnabledODataClient;
> import org.apache.olingo.client.core.android.http.AndroidHttpClientFactory;
>
> And i'm loading the container like this
>   mService = Service.getV4("the ip);
>         mService.getClient().getConfiguration().setHttpClientFactory(new
> AndroidHttpClientFactory());
>         mContainer = mService.getEntityContainer(Container.class);
>
>
> Thanks.
>
>
> On Tue, Jan 13, 2015 at 10:48 AM, Fabio Martelli <fabio.martelli@gmail.com
> > wrote:
>
>>  Il 12/01/2015 17:08, Paul Boldijar ha scritto:
>>
>> Hey, here you go, the metadata
>>
>>
>> Hi Paul, it seems to work fine.
>> Can you provide a snipped code reporting your issue. Please, include
>> imports.
>>
>> Please, check into your imports to be sure to include from v4 package
>> only (v3 package shouldn't appear).
>> Pay attention to EdmEnabledODataClient. See below an example
>>
>> Best regards,
>> F.
>>
>> package net.tirasa.test.olingoproxysample;
>>
>> import
>> net.tirasa.olingoproxysample.net.azurewebsites.odatae2etest.Service;
>> import
>> net.tirasa.olingoproxysample.net.azurewebsites.odatae2etest.entitysets.Container;
>> import
>> net.tirasa.olingoproxysample.net.azurewebsites.odatae2etest.vas.model.types.MaterialCollection;
>> import
>> net.tirasa.olingoproxysample.net.azurewebsites.odatae2etest.vas.model.types.MedicationCollection;
>> import org.apache.olingo.client.api.v4.EdmEnabledODataClient;
>> import org.apache.olingo.commons.api.format.ContentType;
>>
>> public class Main {
>>
>>     public static void main(final String[] args) {
>>         final Service<EdmEnabledODataClient> service = Service.getV4(
>> "http://www.tirasa.net/olingo/services"
>> <http://www.tirasa.net/olingo/services>);
>>
>> service.getClient().getConfiguration().setDefaultBatchAcceptFormat(ContentType.APPLICATION_OCTET_STREAM);
>>         final Container container =
>> service.getEntityContainer(Container.class);
>>
>>         final MaterialCollection materials =
>> container.getMaterials().execute();
>>         final MedicationCollection medication =
>> container.getMaterials().execute(MedicationCollection.class);
>>
>>
>>     }
>> }
>>
>>
>> On Mon, Jan 12, 2015 at 3:37 PM, Fabio Martelli <fabio.martelli@gmail.com
>> > wrote:
>>
>>>  Il 12/01/2015 14:33, Alex Maiereanu ha scritto:
>>>
>>>  Hello Fabio,
>>>
>>>  I know that you are doing this in your spare time. Maybe we can also
>>> help you with some of the bug fixing stuff, but since we don't know the
>>> piping we depend on your knowledge :)
>>>
>>>  We are generating from a V4 Service using ASP.net Web Api.
>>> Medication and Materials are from the same Odata service, same container.
>>>
>>>  Hi Alex, it seems to be a bug in proxy class generation.
>>> Can you attach your metadata (preferred option) or something to help me
>>> to reproduce the problem?
>>>
>>> Kind regards,
>>>
>>> F.
>>>
>>>
>>>   Salutari din Brasov /  Greetings from Brasov
>>>
>>> Alex-Paul Maiereanu
>>>
>>> +40 761 684 212
>>>
>>> www.3sstudio.com
>>>
>>> Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
>>> <https://twitter.com/SmartSocialSoft> Google+
>>> <https://plus.google.com/101299629750815349588/posts>
>>>
>>> On Mon, Jan 12, 2015 at 3:24 PM, Fabio Martelli <
>>> fabio.martelli@gmail.com> wrote:
>>>
>>>>  Il 12/01/2015 13:44, Alex Maiereanu ha scritto:
>>>>
>>>> Hello again,
>>>>
>>>>  So, could somebody from the Olingo team tell me if the Proxy classes
>>>> for Olingo are actually maintained? We can't get any support regarding this
>>>> part of the technologie. Should we start moving our code to the common
>>>> factory classes?
>>>>
>>>>  Hi Alex, Proxy classes are maintained by me and someone else in best
>>>> effort during spare time.
>>>> I can try to give you my help about your last request but I need to
>>>> understand your case better.
>>>>
>>>> 1. are you generating the proxy from a an OData v3 service?
>>>> 2. Medication and Materials are entity of the same OData service? Same
>>>> container?
>>>>
>>>> Please, consider that the same proxy (v3 or v4) has to be generated
>>>> from the same service.
>>>> If this doesn't happen, a bug or configuration problem is occurring.
>>>>
>>>> Please, let me know.
>>>> Best regards,
>>>> F.
>>>>
>>>>
>>>>
>>>>   Salutari din Brasov /  Greetings from Brasov
>>>>
>>>> Alex-Paul Maiereanu
>>>>
>>>> +40 761 684 212 <%2B40%20761%20684%20212>
>>>>
>>>> www.3sstudio.com
>>>>
>>>> Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
>>>> <https://twitter.com/SmartSocialSoft> Google+
>>>> <https://plus.google.com/101299629750815349588/posts>
>>>>
>>>> On Thu, Jan 8, 2015 at 5:33 PM, Alex Maiereanu <
>>>> alex.maiereanu@3sstudio.com> wrote:
>>>>
>>>>> Hello everybody,
>>>>>
>>>>>  To add some more information. Paul is using the Client Proxy
>>>>> classes. The problem is that when the proxies are generated from the
>>>>> container. The instances classes are dynamically generated.
>>>>>
>>>>>  So for a material entity we have a Proxy3 instance type.
>>>>> Medication Entity, that is derived from Material. will be generated as
>>>>> Proxy4.
>>>>>
>>>>>  This names we get if we run method getClass().
>>>>>
>>>>>  Our problem is that, if we have a list of Materials, and afterwards
>>>>> we want to cast this Material to a Medication, the instance type will be of
>>>>> Proxy3 and not Proxy4, so we cant figure out if the material is a material
>>>>> or a medication.
>>>>>
>>>>>
>>>>>   Salutari din Brasov /  Greetings from Brasov
>>>>>
>>>>> Alex-Paul Maiereanu
>>>>>
>>>>> +40 761 684 212 <%2B40%20761%20684%20212>
>>>>>
>>>>> www.3sstudio.com
>>>>>
>>>>> Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
>>>>> <https://twitter.com/SmartSocialSoft> Google+
>>>>> <https://plus.google.com/101299629750815349588/posts>
>>>>>
>>>>> On Wed, Jan 7, 2015 at 4:27 PM, Paul Boldijar <
>>>>> paul.boldijar@3sstudio.com> wrote:
>>>>>
>>>>>> Hello!
>>>>>> I'm using Olingo V4 with android.
>>>>>>
>>>>>>  I have a base entity A, and some derrived classes, such as entity
>>>>>> B, and C.
>>>>>>
>>>>>>  If I want to get all A entities from another entity, the class of
>>>>>> the java object is always A, even if the object is a B entity.
>>>>>>
>>>>>>  The wierd thing is that if I load all the A entities from the
>>>>>> container, everything is ok, the type of the java objects are the right
>>>>>> ones.
>>>>>>
>>>>>>  And also, can I get from an odata entity to a 'EntityInvocationHandler'
>>>>>> object?
>>>>>>
>>>>>>  Thank you.
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>   --
>>>> Fabio Martelli
>>>>
>>>> Tirasa - Open Source Excellencehttp://www.tirasa.net/
>>>>
>>>> Apache Syncope PMChttp://people.apache.org/~fmartelli/
>>>>
>>>>
>>>
>>>
>>> --
>>> Fabio Martelli
>>>
>>> Tirasa - Open Source Excellencehttp://www.tirasa.net/
>>>
>>> Apache Syncope PMChttp://people.apache.org/~fmartelli/
>>>
>>>
>>
>>
>> --
>> Fabio Martelli
>>
>> Tirasa - Open Source Excellencehttp://www.tirasa.net/
>>
>> Apache Syncope PMChttp://people.apache.org/~fmartelli/
>>
>>
>

Re: Problem with Olingo V4

Posted by Paul Boldijar <pa...@3sstudio.com>.
Ok here is the exact problem.
A client has a deposit, which has a collection of stocks. A stock has a
field for material.


client.expand("Deposit").load();
            Deposit clientDeposit = client.getDeposit();
            Integer id = clientDeposit.getId();
            StockCollection clientStocks =
clientDeposit.getStocks().expand("Material").execute();
            // a stock has a Material field
            for (Stock stock : clientStocks) {
                Material material = stock.getMaterial();
                // here , the materials don't have the derived class type,
if this Material is on the server a instance of Vaccine (which is derrived
from Material),
                // material instanceof Vaccine will always return false
                // and material.getClass.getName() will always be $Proxy31

            }

The imports are ok
import com.studio3s.vetandroid.veterinarian.Model.Odata.Service;
import
com.studio3s.vetandroid.veterinarian.Model.Odata.entitysets.Container;

import org.apache.olingo.client.api.v4.EdmEnabledODataClient;
import org.apache.olingo.client.core.android.http.AndroidHttpClientFactory;

And i'm loading the container like this
  mService = Service.getV4("the ip);
        mService.getClient().getConfiguration().setHttpClientFactory(new
AndroidHttpClientFactory());
        mContainer = mService.getEntityContainer(Container.class);


Thanks.


On Tue, Jan 13, 2015 at 10:48 AM, Fabio Martelli <fa...@gmail.com>
wrote:

>  Il 12/01/2015 17:08, Paul Boldijar ha scritto:
>
> Hey, here you go, the metadata
>
>
> Hi Paul, it seems to work fine.
> Can you provide a snipped code reporting your issue. Please, include
> imports.
>
> Please, check into your imports to be sure to include from v4 package only
> (v3 package shouldn't appear).
> Pay attention to EdmEnabledODataClient. See below an example
>
> Best regards,
> F.
>
> package net.tirasa.test.olingoproxysample;
>
> import net.tirasa.olingoproxysample.net.azurewebsites.odatae2etest.Service;
> import
> net.tirasa.olingoproxysample.net.azurewebsites.odatae2etest.entitysets.Container;
> import
> net.tirasa.olingoproxysample.net.azurewebsites.odatae2etest.vas.model.types.MaterialCollection;
> import
> net.tirasa.olingoproxysample.net.azurewebsites.odatae2etest.vas.model.types.MedicationCollection;
> import org.apache.olingo.client.api.v4.EdmEnabledODataClient;
> import org.apache.olingo.commons.api.format.ContentType;
>
> public class Main {
>
>     public static void main(final String[] args) {
>         final Service<EdmEnabledODataClient> service = Service.getV4(
> "http://www.tirasa.net/olingo/services"
> <http://www.tirasa.net/olingo/services>);
>
> service.getClient().getConfiguration().setDefaultBatchAcceptFormat(ContentType.APPLICATION_OCTET_STREAM);
>         final Container container =
> service.getEntityContainer(Container.class);
>
>         final MaterialCollection materials =
> container.getMaterials().execute();
>         final MedicationCollection medication =
> container.getMaterials().execute(MedicationCollection.class);
>
>
>     }
> }
>
>
> On Mon, Jan 12, 2015 at 3:37 PM, Fabio Martelli <fa...@gmail.com>
> wrote:
>
>>  Il 12/01/2015 14:33, Alex Maiereanu ha scritto:
>>
>>  Hello Fabio,
>>
>>  I know that you are doing this in your spare time. Maybe we can also
>> help you with some of the bug fixing stuff, but since we don't know the
>> piping we depend on your knowledge :)
>>
>>  We are generating from a V4 Service using ASP.net Web Api.
>> Medication and Materials are from the same Odata service, same container.
>>
>>  Hi Alex, it seems to be a bug in proxy class generation.
>> Can you attach your metadata (preferred option) or something to help me
>> to reproduce the problem?
>>
>> Kind regards,
>>
>> F.
>>
>>
>>   Salutari din Brasov /  Greetings from Brasov
>>
>> Alex-Paul Maiereanu
>>
>> +40 761 684 212
>>
>> www.3sstudio.com
>>
>> Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
>> <https://twitter.com/SmartSocialSoft> Google+
>> <https://plus.google.com/101299629750815349588/posts>
>>
>> On Mon, Jan 12, 2015 at 3:24 PM, Fabio Martelli <fabio.martelli@gmail.com
>> > wrote:
>>
>>>  Il 12/01/2015 13:44, Alex Maiereanu ha scritto:
>>>
>>> Hello again,
>>>
>>>  So, could somebody from the Olingo team tell me if the Proxy classes
>>> for Olingo are actually maintained? We can't get any support regarding this
>>> part of the technologie. Should we start moving our code to the common
>>> factory classes?
>>>
>>>  Hi Alex, Proxy classes are maintained by me and someone else in best
>>> effort during spare time.
>>> I can try to give you my help about your last request but I need to
>>> understand your case better.
>>>
>>> 1. are you generating the proxy from a an OData v3 service?
>>> 2. Medication and Materials are entity of the same OData service? Same
>>> container?
>>>
>>> Please, consider that the same proxy (v3 or v4) has to be generated from
>>> the same service.
>>> If this doesn't happen, a bug or configuration problem is occurring.
>>>
>>> Please, let me know.
>>> Best regards,
>>> F.
>>>
>>>
>>>
>>>   Salutari din Brasov /  Greetings from Brasov
>>>
>>> Alex-Paul Maiereanu
>>>
>>> +40 761 684 212 <%2B40%20761%20684%20212>
>>>
>>> www.3sstudio.com
>>>
>>> Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
>>> <https://twitter.com/SmartSocialSoft> Google+
>>> <https://plus.google.com/101299629750815349588/posts>
>>>
>>> On Thu, Jan 8, 2015 at 5:33 PM, Alex Maiereanu <
>>> alex.maiereanu@3sstudio.com> wrote:
>>>
>>>> Hello everybody,
>>>>
>>>>  To add some more information. Paul is using the Client Proxy classes.
>>>> The problem is that when the proxies are generated from the container. The
>>>> instances classes are dynamically generated.
>>>>
>>>>  So for a material entity we have a Proxy3 instance type.
>>>> Medication Entity, that is derived from Material. will be generated as
>>>> Proxy4.
>>>>
>>>>  This names we get if we run method getClass().
>>>>
>>>>  Our problem is that, if we have a list of Materials, and afterwards
>>>> we want to cast this Material to a Medication, the instance type will be of
>>>> Proxy3 and not Proxy4, so we cant figure out if the material is a material
>>>> or a medication.
>>>>
>>>>
>>>>   Salutari din Brasov /  Greetings from Brasov
>>>>
>>>> Alex-Paul Maiereanu
>>>>
>>>> +40 761 684 212 <%2B40%20761%20684%20212>
>>>>
>>>> www.3sstudio.com
>>>>
>>>> Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
>>>> <https://twitter.com/SmartSocialSoft> Google+
>>>> <https://plus.google.com/101299629750815349588/posts>
>>>>
>>>> On Wed, Jan 7, 2015 at 4:27 PM, Paul Boldijar <
>>>> paul.boldijar@3sstudio.com> wrote:
>>>>
>>>>> Hello!
>>>>> I'm using Olingo V4 with android.
>>>>>
>>>>>  I have a base entity A, and some derrived classes, such as entity B,
>>>>> and C.
>>>>>
>>>>>  If I want to get all A entities from another entity, the class of
>>>>> the java object is always A, even if the object is a B entity.
>>>>>
>>>>>  The wierd thing is that if I load all the A entities from the
>>>>> container, everything is ok, the type of the java objects are the right
>>>>> ones.
>>>>>
>>>>>  And also, can I get from an odata entity to a 'EntityInvocationHandler'
>>>>> object?
>>>>>
>>>>>  Thank you.
>>>>>
>>>>
>>>>
>>>
>>>
>>>   --
>>> Fabio Martelli
>>>
>>> Tirasa - Open Source Excellencehttp://www.tirasa.net/
>>>
>>> Apache Syncope PMChttp://people.apache.org/~fmartelli/
>>>
>>>
>>
>>
>> --
>> Fabio Martelli
>>
>> Tirasa - Open Source Excellencehttp://www.tirasa.net/
>>
>> Apache Syncope PMChttp://people.apache.org/~fmartelli/
>>
>>
>
>
> --
> Fabio Martelli
>
> Tirasa - Open Source Excellencehttp://www.tirasa.net/
>
> Apache Syncope PMChttp://people.apache.org/~fmartelli/
>
>

Re: Problem with Olingo V4

Posted by Fabio Martelli <fa...@gmail.com>.
Il 12/01/2015 17:08, Paul Boldijar ha scritto:
> Hey, here you go, the metadata

Hi Paul, it seems to work fine.
Can you provide a snipped code reporting your issue. Please, include 
imports.

Please, check into your imports to be sure to include from v4 package 
only (v3 package shouldn't appear).
Pay attention to EdmEnabledODataClient. See below an example

Best regards,
F.

package net.tirasa.test.olingoproxysample;

import net.tirasa.olingoproxysample.net.azurewebsites.odatae2etest.Service;
import 
net.tirasa.olingoproxysample.net.azurewebsites.odatae2etest.entitysets.Container;
import 
net.tirasa.olingoproxysample.net.azurewebsites.odatae2etest.vas.model.types.MaterialCollection;
import 
net.tirasa.olingoproxysample.net.azurewebsites.odatae2etest.vas.model.types.MedicationCollection;
import org.apache.olingo.client.api.v4.EdmEnabledODataClient;
import org.apache.olingo.commons.api.format.ContentType;

public class Main {

     public static void main(final String[] args) {
         final Service<EdmEnabledODataClient> service = 
Service.getV4("http://www.tirasa.net/olingo/services");
service.getClient().getConfiguration().setDefaultBatchAcceptFormat(ContentType.APPLICATION_OCTET_STREAM);
         final Container container = 
service.getEntityContainer(Container.class);

         final MaterialCollection materials = 
container.getMaterials().execute();
         final MedicationCollection medication = 
container.getMaterials().execute(MedicationCollection.class);

     }
}

>
> On Mon, Jan 12, 2015 at 3:37 PM, Fabio Martelli 
> <fabio.martelli@gmail.com <ma...@gmail.com>> wrote:
>
>     Il 12/01/2015 14:33, Alex Maiereanu ha scritto:
>>     Hello Fabio,
>>
>>     I know that you are doing this in your spare time. Maybe we can
>>     also help you with some of the bug fixing stuff, but since we
>>     don't know the piping we depend on your knowledge :)
>>
>>     We are generating from a V4 Service using ASP.net Web Api.
>>     Medication and Materials are from the same Odata service, same
>>     container.
>     Hi Alex, it seems to be a bug in proxy class generation.
>     Can you attach your metadata (preferred option) or something to
>     help me to reproduce the problem?
>
>     Kind regards,
>
>     F.
>
>>
>>     Salutari din Brasov /  Greetings from Brasov
>>
>>     Alex-Paul Maiereanu
>>
>>     +40 761 684 212 <tel:%2B40%20761%20684%20212>
>>
>>     www.3sstudio.com <http://www.3sstudio.com/>
>>
>>     Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
>>     <https://twitter.com/SmartSocialSoft> Google+
>>     <https://plus.google.com/101299629750815349588/posts>
>>
>>
>>     On Mon, Jan 12, 2015 at 3:24 PM, Fabio Martelli
>>     <fabio.martelli@gmail.com <ma...@gmail.com>> wrote:
>>
>>         Il 12/01/2015 13:44, Alex Maiereanu ha scritto:
>>>         Hello again,
>>>
>>>         So, could somebody from the Olingo team tell me if the Proxy
>>>         classes for Olingo are actually maintained? We can't get any
>>>         support regarding this part of the technologie. Should we
>>>         start moving our code to the common factory classes?
>>         Hi Alex, Proxy classes are maintained by me and someone else
>>         in best effort during spare time.
>>         I can try to give you my help about your last request but I
>>         need to understand your case better.
>>
>>         1. are you generating the proxy from a an OData v3 service?
>>         2. Medication and Materials are entity of the same OData
>>         service? Same container?
>>
>>         Please, consider that the same proxy (v3 or v4) has to be
>>         generated from the same service.
>>         If this doesn't happen, a bug or configuration problem is
>>         occurring.
>>
>>         Please, let me know.
>>         Best regards,
>>         F.
>>
>>
>>>
>>>         Salutari din Brasov /  Greetings from Brasov
>>>
>>>         Alex-Paul Maiereanu
>>>
>>>         +40 761 684 212 <tel:%2B40%20761%20684%20212>
>>>
>>>         www.3sstudio.com <http://www.3sstudio.com/>
>>>
>>>         Facebook <https://www.facebook.com/smartsocialsoftware>
>>>         Twitter <https://twitter.com/SmartSocialSoft> Google+
>>>         <https://plus.google.com/101299629750815349588/posts>
>>>
>>>
>>>         On Thu, Jan 8, 2015 at 5:33 PM, Alex Maiereanu
>>>         <alex.maiereanu@3sstudio.com
>>>         <ma...@3sstudio.com>> wrote:
>>>
>>>             Hello everybody,
>>>
>>>             To add some more information. Paul is using the Client
>>>             Proxy classes. The problem is that when the proxies are
>>>             generated from the container. The instances classes are
>>>             dynamically generated.
>>>
>>>             So for a material entity we have a Proxy3 instance type.
>>>             Medication Entity, that is derived from Material. will
>>>             be generated as Proxy4.
>>>
>>>             This names we get if we run method getClass().
>>>
>>>             Our problem is that, if we have a list of Materials, and
>>>             afterwards we want to cast this Material to a
>>>             Medication, the instance type will be of Proxy3 and not
>>>             Proxy4, so we cant figure out if the material is a
>>>             material or a medication.
>>>
>>>
>>>             Salutari din Brasov /  Greetings from Brasov
>>>
>>>             Alex-Paul Maiereanu
>>>
>>>             +40 761 684 212 <tel:%2B40%20761%20684%20212>
>>>
>>>             www.3sstudio.com <http://www.3sstudio.com/>
>>>
>>>             Facebook <https://www.facebook.com/smartsocialsoftware>
>>>             Twitter <https://twitter.com/SmartSocialSoft> Google+
>>>             <https://plus.google.com/101299629750815349588/posts>
>>>
>>>
>>>             On Wed, Jan 7, 2015 at 4:27 PM, Paul Boldijar
>>>             <paul.boldijar@3sstudio.com
>>>             <ma...@3sstudio.com>> wrote:
>>>
>>>                 Hello!
>>>                 I'm using Olingo V4 with android.
>>>
>>>                 I have a base entity A, and some derrived classes,
>>>                 such as entity B, and C.
>>>
>>>                 If I want to get all A entities from another entity,
>>>                 the class of the java object is always A, even if
>>>                 the object is a B entity.
>>>
>>>                 The wierd thing is that if I load all the A entities
>>>                 from the container, everything is ok, the type of
>>>                 the java objects are the right ones.
>>>
>>>                 And also, can I get from an odata entity to a
>>>                 'EntityInvocationHandler' object?
>>>
>>>                 Thank you.
>>>
>>>
>>>
>>
>>
>>         -- 
>>         Fabio Martelli
>>
>>         Tirasa - Open Source Excellence
>>         http://www.tirasa.net/
>>
>>         Apache Syncope PMC
>>         http://people.apache.org/~fmartelli/  <http://people.apache.org/%7Efmartelli/>
>>
>>
>
>
>     -- 
>     Fabio Martelli
>
>     Tirasa - Open Source Excellence
>     http://www.tirasa.net/
>
>     Apache Syncope PMC
>     http://people.apache.org/~fmartelli/  <http://people.apache.org/%7Efmartelli/>
>
>


-- 
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 Paul Boldijar <pa...@3sstudio.com>.
Hey, here you go, the metadata

On Mon, Jan 12, 2015 at 3:37 PM, Fabio Martelli <fa...@gmail.com>
wrote:

>  Il 12/01/2015 14:33, Alex Maiereanu ha scritto:
>
>  Hello Fabio,
>
>  I know that you are doing this in your spare time. Maybe we can also
> help you with some of the bug fixing stuff, but since we don't know the
> piping we depend on your knowledge :)
>
>  We are generating from a V4 Service using ASP.net Web Api.
> Medication and Materials are from the same Odata service, same container.
>
> Hi Alex, it seems to be a bug in proxy class generation.
> Can you attach your metadata (preferred option) or something to help me to
> reproduce the problem?
>
> Kind regards,
>
> F.
>
>
>   Salutari din Brasov /  Greetings from Brasov
>
> Alex-Paul Maiereanu
>
> +40 761 684 212
>
> www.3sstudio.com
>
> Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
> <https://twitter.com/SmartSocialSoft> Google+
> <https://plus.google.com/101299629750815349588/posts>
>
> On Mon, Jan 12, 2015 at 3:24 PM, Fabio Martelli <fa...@gmail.com>
> wrote:
>
>>  Il 12/01/2015 13:44, Alex Maiereanu ha scritto:
>>
>> Hello again,
>>
>>  So, could somebody from the Olingo team tell me if the Proxy classes
>> for Olingo are actually maintained? We can't get any support regarding this
>> part of the technologie. Should we start moving our code to the common
>> factory classes?
>>
>>  Hi Alex, Proxy classes are maintained by me and someone else in best
>> effort during spare time.
>> I can try to give you my help about your last request but I need to
>> understand your case better.
>>
>> 1. are you generating the proxy from a an OData v3 service?
>> 2. Medication and Materials are entity of the same OData service? Same
>> container?
>>
>> Please, consider that the same proxy (v3 or v4) has to be generated from
>> the same service.
>> If this doesn't happen, a bug or configuration problem is occurring.
>>
>> Please, let me know.
>> Best regards,
>> F.
>>
>>
>>
>>   Salutari din Brasov /  Greetings from Brasov
>>
>> Alex-Paul Maiereanu
>>
>> +40 761 684 212
>>
>> www.3sstudio.com
>>
>> Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
>> <https://twitter.com/SmartSocialSoft> Google+
>> <https://plus.google.com/101299629750815349588/posts>
>>
>> On Thu, Jan 8, 2015 at 5:33 PM, Alex Maiereanu <
>> alex.maiereanu@3sstudio.com> wrote:
>>
>>> Hello everybody,
>>>
>>>  To add some more information. Paul is using the Client Proxy classes.
>>> The problem is that when the proxies are generated from the container. The
>>> instances classes are dynamically generated.
>>>
>>>  So for a material entity we have a Proxy3 instance type.
>>> Medication Entity, that is derived from Material. will be generated as
>>> Proxy4.
>>>
>>>  This names we get if we run method getClass().
>>>
>>>  Our problem is that, if we have a list of Materials, and afterwards we
>>> want to cast this Material to a Medication, the instance type will be of
>>> Proxy3 and not Proxy4, so we cant figure out if the material is a material
>>> or a medication.
>>>
>>>
>>>   Salutari din Brasov /  Greetings from Brasov
>>>
>>> Alex-Paul Maiereanu
>>>
>>> +40 761 684 212 <%2B40%20761%20684%20212>
>>>
>>> www.3sstudio.com
>>>
>>> Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
>>> <https://twitter.com/SmartSocialSoft> Google+
>>> <https://plus.google.com/101299629750815349588/posts>
>>>
>>> On Wed, Jan 7, 2015 at 4:27 PM, Paul Boldijar <
>>> paul.boldijar@3sstudio.com> wrote:
>>>
>>>> Hello!
>>>> I'm using Olingo V4 with android.
>>>>
>>>>  I have a base entity A, and some derrived classes, such as entity B,
>>>> and C.
>>>>
>>>>  If I want to get all A entities from another entity, the class of the
>>>> java object is always A, even if the object is a B entity.
>>>>
>>>>  The wierd thing is that if I load all the A entities from the
>>>> container, everything is ok, the type of the java objects are the right
>>>> ones.
>>>>
>>>>  And also, can I get from an odata entity to a 'EntityInvocationHandler'
>>>> object?
>>>>
>>>>  Thank you.
>>>>
>>>
>>>
>>
>>
>>   --
>> Fabio Martelli
>>
>> Tirasa - Open Source Excellencehttp://www.tirasa.net/
>>
>> Apache Syncope PMChttp://people.apache.org/~fmartelli/
>>
>>
>
>
> --
> Fabio Martelli
>
> Tirasa - Open Source Excellencehttp://www.tirasa.net/
>
> Apache Syncope PMChttp://people.apache.org/~fmartelli/
>
>

Re: Problem with Olingo V4

Posted by Fabio Martelli <fa...@gmail.com>.
Il 12/01/2015 14:33, Alex Maiereanu ha scritto:
> Hello Fabio,
>
> I know that you are doing this in your spare time. Maybe we can also 
> help you with some of the bug fixing stuff, but since we don't know 
> the piping we depend on your knowledge :)
>
> We are generating from a V4 Service using ASP.net Web Api.
> Medication and Materials are from the same Odata service, same container.
Hi Alex, it seems to be a bug in proxy class generation.
Can you attach your metadata (preferred option) or something to help me 
to reproduce the problem?

Kind regards,
F.

>
> Salutari din Brasov /  Greetings from Brasov
>
> Alex-Paul Maiereanu
>
> +40 761 684 212
>
> www.3sstudio.com <http://www.3sstudio.com/>
>
> Facebook <https://www.facebook.com/smartsocialsoftware> Twitter 
> <https://twitter.com/SmartSocialSoft> Google+ 
> <https://plus.google.com/101299629750815349588/posts>
>
>
> On Mon, Jan 12, 2015 at 3:24 PM, Fabio Martelli 
> <fabio.martelli@gmail.com <ma...@gmail.com>> wrote:
>
>     Il 12/01/2015 13:44, Alex Maiereanu ha scritto:
>>     Hello again,
>>
>>     So, could somebody from the Olingo team tell me if the Proxy
>>     classes for Olingo are actually maintained? We can't get any
>>     support regarding this part of the technologie. Should we start
>>     moving our code to the common factory classes?
>     Hi Alex, Proxy classes are maintained by me and someone else in
>     best effort during spare time.
>     I can try to give you my help about your last request but I need
>     to understand your case better.
>
>     1. are you generating the proxy from a an OData v3 service?
>     2. Medication and Materials are entity of the same OData service?
>     Same container?
>
>     Please, consider that the same proxy (v3 or v4) has to be
>     generated from the same service.
>     If this doesn't happen, a bug or configuration problem is occurring.
>
>     Please, let me know.
>     Best regards,
>     F.
>
>
>>
>>     Salutari din Brasov /  Greetings from Brasov
>>
>>     Alex-Paul Maiereanu
>>
>>     +40 761 684 212 <tel:%2B40%20761%20684%20212>
>>
>>     www.3sstudio.com <http://www.3sstudio.com/>
>>
>>     Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
>>     <https://twitter.com/SmartSocialSoft> Google+
>>     <https://plus.google.com/101299629750815349588/posts>
>>
>>
>>     On Thu, Jan 8, 2015 at 5:33 PM, Alex Maiereanu
>>     <alex.maiereanu@3sstudio.com
>>     <ma...@3sstudio.com>> wrote:
>>
>>         Hello everybody,
>>
>>         To add some more information. Paul is using the Client Proxy
>>         classes. The problem is that when the proxies are generated
>>         from the container. The instances classes are dynamically
>>         generated.
>>
>>         So for a material entity we have a Proxy3 instance type.
>>         Medication Entity, that is derived from Material. will be
>>         generated as Proxy4.
>>
>>         This names we get if we run method getClass().
>>
>>         Our problem is that, if we have a list of Materials, and
>>         afterwards we want to cast this Material to a Medication, the
>>         instance type will be of Proxy3 and not Proxy4, so we cant
>>         figure out if the material is a material or a medication.
>>
>>
>>         Salutari din Brasov /  Greetings from Brasov
>>
>>         Alex-Paul Maiereanu
>>
>>         +40 761 684 212 <tel:%2B40%20761%20684%20212>
>>
>>         www.3sstudio.com <http://www.3sstudio.com/>
>>
>>         Facebook <https://www.facebook.com/smartsocialsoftware>
>>         Twitter <https://twitter.com/SmartSocialSoft> Google+
>>         <https://plus.google.com/101299629750815349588/posts>
>>
>>
>>         On Wed, Jan 7, 2015 at 4:27 PM, Paul Boldijar
>>         <paul.boldijar@3sstudio.com
>>         <ma...@3sstudio.com>> wrote:
>>
>>             Hello!
>>             I'm using Olingo V4 with android.
>>
>>             I have a base entity A, and some derrived classes, such
>>             as entity B, and C.
>>
>>             If I want to get all A entities from another entity, the
>>             class of the java object is always A, even if the object
>>             is a B entity.
>>
>>             The wierd thing is that if I load all the A entities from
>>             the container, everything is ok, the type of the java
>>             objects are the right ones.
>>
>>             And also, can I get from an odata entity to a
>>             'EntityInvocationHandler' object?
>>
>>             Thank you.
>>
>>
>>
>
>
>     -- 
>     Fabio Martelli
>
>     Tirasa - Open Source Excellence
>     http://www.tirasa.net/
>
>     Apache Syncope PMC
>     http://people.apache.org/~fmartelli/  <http://people.apache.org/%7Efmartelli/>
>
>


-- 
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 Alex Maiereanu <al...@3sstudio.com>.
Hello Fabio,

I know that you are doing this in your spare time. Maybe we can also help
you with some of the bug fixing stuff, but since we don't know the piping
we depend on your knowledge :)

We are generating from a V4 Service using ASP.net Web Api.
Medication and Materials are from the same Odata service, same container.

 Salutari din Brasov /  Greetings from Brasov

Alex-Paul Maiereanu

+40 761 684 212

www.3sstudio.com

Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
<https://twitter.com/SmartSocialSoft> Google+
<https://plus.google.com/101299629750815349588/posts>

On Mon, Jan 12, 2015 at 3:24 PM, Fabio Martelli <fa...@gmail.com>
wrote:

>  Il 12/01/2015 13:44, Alex Maiereanu ha scritto:
>
> Hello again,
>
>  So, could somebody from the Olingo team tell me if the Proxy classes for
> Olingo are actually maintained? We can't get any support regarding this
> part of the technologie. Should we start moving our code to the common
> factory classes?
>
> Hi Alex, Proxy classes are maintained by me and someone else in best
> effort during spare time.
> I can try to give you my help about your last request but I need to
> understand your case better.
>
> 1. are you generating the proxy from a an OData v3 service?
> 2. Medication and Materials are entity of the same OData service? Same
> container?
>
> Please, consider that the same proxy (v3 or v4) has to be generated from
> the same service.
> If this doesn't happen, a bug or configuration problem is occurring.
>
> Please, let me know.
> Best regards,
> F.
>
>
>
>   Salutari din Brasov /  Greetings from Brasov
>
> Alex-Paul Maiereanu
>
> +40 761 684 212
>
> www.3sstudio.com
>
> Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
> <https://twitter.com/SmartSocialSoft> Google+
> <https://plus.google.com/101299629750815349588/posts>
>
> On Thu, Jan 8, 2015 at 5:33 PM, Alex Maiereanu <
> alex.maiereanu@3sstudio.com> wrote:
>
>> Hello everybody,
>>
>>  To add some more information. Paul is using the Client Proxy classes.
>> The problem is that when the proxies are generated from the container. The
>> instances classes are dynamically generated.
>>
>>  So for a material entity we have a Proxy3 instance type.
>> Medication Entity, that is derived from Material. will be generated as
>> Proxy4.
>>
>>  This names we get if we run method getClass().
>>
>>  Our problem is that, if we have a list of Materials, and afterwards we
>> want to cast this Material to a Medication, the instance type will be of
>> Proxy3 and not Proxy4, so we cant figure out if the material is a material
>> or a medication.
>>
>>
>>   Salutari din Brasov /  Greetings from Brasov
>>
>> Alex-Paul Maiereanu
>>
>> +40 761 684 212 <%2B40%20761%20684%20212>
>>
>> www.3sstudio.com
>>
>> Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
>> <https://twitter.com/SmartSocialSoft> Google+
>> <https://plus.google.com/101299629750815349588/posts>
>>
>> On Wed, Jan 7, 2015 at 4:27 PM, Paul Boldijar <paul.boldijar@3sstudio.com
>> > wrote:
>>
>>> Hello!
>>> I'm using Olingo V4 with android.
>>>
>>>  I have a base entity A, and some derrived classes, such as entity B,
>>> and C.
>>>
>>>  If I want to get all A entities from another entity, the class of the
>>> java object is always A, even if the object is a B entity.
>>>
>>>  The wierd thing is that if I load all the A entities from the
>>> container, everything is ok, the type of the java objects are the right
>>> ones.
>>>
>>>  And also, can I get from an odata entity to a 'EntityInvocationHandler'
>>> object?
>>>
>>>  Thank you.
>>>
>>
>>
>
>
> --
> Fabio Martelli
>
> Tirasa - Open Source Excellencehttp://www.tirasa.net/
>
> Apache Syncope PMChttp://people.apache.org/~fmartelli/
>
>

Re: Problem with Olingo V4

Posted by Fabio Martelli <fa...@gmail.com>.
Il 12/01/2015 13:44, Alex Maiereanu ha scritto:
> Hello again,
>
> So, could somebody from the Olingo team tell me if the Proxy classes 
> for Olingo are actually maintained? We can't get any support regarding 
> this part of the technologie. Should we start moving our code to the 
> common factory classes?
Hi Alex, Proxy classes are maintained by me and someone else in best 
effort during spare time.
I can try to give you my help about your last request but I need to 
understand your case better.

1. are you generating the proxy from a an OData v3 service?
2. Medication and Materials are entity of the same OData service? Same 
container?

Please, consider that the same proxy (v3 or v4) has to be generated from 
the same service.
If this doesn't happen, a bug or configuration problem is occurring.

Please, let me know.
Best regards,
F.

>
> Salutari din Brasov /  Greetings from Brasov
>
> Alex-Paul Maiereanu
>
> +40 761 684 212
>
> www.3sstudio.com <http://www.3sstudio.com/>
>
> Facebook <https://www.facebook.com/smartsocialsoftware> Twitter 
> <https://twitter.com/SmartSocialSoft> Google+ 
> <https://plus.google.com/101299629750815349588/posts>
>
>
> On Thu, Jan 8, 2015 at 5:33 PM, Alex Maiereanu 
> <alex.maiereanu@3sstudio.com <ma...@3sstudio.com>> wrote:
>
>     Hello everybody,
>
>     To add some more information. Paul is using the Client Proxy
>     classes. The problem is that when the proxies are generated from
>     the container. The instances classes are dynamically generated.
>
>     So for a material entity we have a Proxy3 instance type.
>     Medication Entity, that is derived from Material. will be
>     generated as Proxy4.
>
>     This names we get if we run method getClass().
>
>     Our problem is that, if we have a list of Materials, and
>     afterwards we want to cast this Material to a Medication, the
>     instance type will be of Proxy3 and not Proxy4, so we cant figure
>     out if the material is a material or a medication.
>
>
>     Salutari din Brasov /  Greetings from Brasov
>
>     Alex-Paul Maiereanu
>
>     +40 761 684 212 <tel:%2B40%20761%20684%20212>
>
>     www.3sstudio.com <http://www.3sstudio.com/>
>
>     Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
>     <https://twitter.com/SmartSocialSoft> Google+
>     <https://plus.google.com/101299629750815349588/posts>
>
>
>     On Wed, Jan 7, 2015 at 4:27 PM, Paul Boldijar
>     <paul.boldijar@3sstudio.com <ma...@3sstudio.com>>
>     wrote:
>
>         Hello!
>         I'm using Olingo V4 with android.
>
>         I have a base entity A, and some derrived classes, such as
>         entity B, and C.
>
>         If I want to get all A entities from another entity, the class
>         of the java object is always A, even if the object is a B entity.
>
>         The wierd thing is that if I load all the A entities from the
>         container, everything is ok, the type of the java objects are
>         the right ones.
>
>         And also, can I get from an odata entity to a
>         'EntityInvocationHandler' object?
>
>         Thank you.
>
>
>


-- 
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 Alex Maiereanu <al...@3sstudio.com>.
Hello again,

So, could somebody from the Olingo team tell me if the Proxy classes for
Olingo are actually maintained? We can't get any support regarding this
part of the technologie. Should we start moving our code to the common
factory classes?

 Salutari din Brasov /  Greetings from Brasov

Alex-Paul Maiereanu

+40 761 684 212

www.3sstudio.com

Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
<https://twitter.com/SmartSocialSoft> Google+
<https://plus.google.com/101299629750815349588/posts>

On Thu, Jan 8, 2015 at 5:33 PM, Alex Maiereanu <al...@3sstudio.com>
wrote:

> Hello everybody,
>
> To add some more information. Paul is using the Client Proxy classes. The
> problem is that when the proxies are generated from the container. The
> instances classes are dynamically generated.
>
> So for a material entity we have a Proxy3 instance type.
> Medication Entity, that is derived from Material. will be generated as
> Proxy4.
>
> This names we get if we run method getClass().
>
> Our problem is that, if we have a list of Materials, and afterwards we
> want to cast this Material to a Medication, the instance type will be of
> Proxy3 and not Proxy4, so we cant figure out if the material is a material
> or a medication.
>
>
>  Salutari din Brasov /  Greetings from Brasov
>
> Alex-Paul Maiereanu
>
> +40 761 684 212
>
> www.3sstudio.com
>
> Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
> <https://twitter.com/SmartSocialSoft> Google+
> <https://plus.google.com/101299629750815349588/posts>
>
> On Wed, Jan 7, 2015 at 4:27 PM, Paul Boldijar <pa...@3sstudio.com>
> wrote:
>
>> Hello!
>> I'm using Olingo V4 with android.
>>
>> I have a base entity A, and some derrived classes, such as entity B, and
>> C.
>>
>> If I want to get all A entities from another entity, the class of the
>> java object is always A, even if the object is a B entity.
>>
>> The wierd thing is that if I load all the A entities from the container,
>> everything is ok, the type of the java objects are the right ones.
>>
>> And also, can I get from an odata entity to a 'EntityInvocationHandler'
>> object?
>>
>> Thank you.
>>
>
>

Re: Problem with Olingo V4

Posted by Alex Maiereanu <al...@3sstudio.com>.
Hello everybody,

To add some more information. Paul is using the Client Proxy classes. The
problem is that when the proxies are generated from the container. The
instances classes are dynamically generated.

So for a material entity we have a Proxy3 instance type.
Medication Entity, that is derived from Material. will be generated as
Proxy4.

This names we get if we run method getClass().

Our problem is that, if we have a list of Materials, and afterwards we want
to cast this Material to a Medication, the instance type will be of Proxy3
and not Proxy4, so we cant figure out if the material is a material or a
medication.


 Salutari din Brasov /  Greetings from Brasov

Alex-Paul Maiereanu

+40 761 684 212

www.3sstudio.com

Facebook <https://www.facebook.com/smartsocialsoftware> Twitter
<https://twitter.com/SmartSocialSoft> Google+
<https://plus.google.com/101299629750815349588/posts>

On Wed, Jan 7, 2015 at 4:27 PM, Paul Boldijar <pa...@3sstudio.com>
wrote:

> Hello!
> I'm using Olingo V4 with android.
>
> I have a base entity A, and some derrived classes, such as entity B, and C.
>
> If I want to get all A entities from another entity, the class of the java
> object is always A, even if the object is a B entity.
>
> The wierd thing is that if I load all the A entities from the container,
> everything is ok, the type of the java objects are the right ones.
>
> And also, can I get from an odata entity to a 'EntityInvocationHandler'
> object?
>
> Thank you.
>