You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@olingo.apache.org by "Roehrig, Stefan" <st...@vaillant-group.com> on 2014/08/14 09:22:35 UTC

AW: Function import with annotations

Hi Michael,

I’ll start to work on the issues now.

I’ve got two questions:

-          How should I annotate an enum?

-          How should I annotate a list of objects which are complex types?

I’ll start with the optimized read for entities.

Kind regards,
Stefan

--
Stefan Röhrig – Consultant Group IT - BPM

Vaillant Group IT
Tel. +49 2191 18 4725 • Mobile +49 175 2951 757 • Fax +49 2191 18 74725
E-Mail: stefan.roehrig@vaillant-group.com<ma...@vaillant-group.com> • http://www.vaillant-group.com<http://www.vaillant-group.com/>

Vaillant Group Business Services GmbH, Berghauser Str. 63, D-42859 Remscheid
Sitz: Remscheid • Registergericht: Amtsgericht Wuppertal HRB 11591 • Geschäftsführer: Dr. Stefan Borchers, Cahit Gürdal Ergüven
Always think green before printing!


Von: Bolz, Michael [mailto:michael.bolz@sap.com]
Gesendet: Montag, 30. Juni 2014 20:20
An: user@olingo.apache.org
Betreff: Re: Function import with annotations

Hi Stefan,

nice to hear  ;o)

Kind regards,
Michael


On 30.06.2014, at 18:42, Roehrig, Stefan <st...@vaillant-group.com>> wrote:


Hi Michael,

the solution works, thanks!

Kind regards,
Stefan
--
Stefan Röhrig – Consultant Group IT - BPM

Vaillant Group IT
Tel. +49 2191 18 4725 • Mobile +49 175 2951 757 • Fax +49 2191 18 74725
E-Mail: stefan.roehrig@vaillant-group.com<ma...@vaillant-group.com> • http://www.vaillant-group.com<http://www.vaillant-group.com/>

Vaillant Group Business Services GmbH, Berghauser Str. 63, D-42859 Remscheid
Sitz: Remscheid • Registergericht: Amtsgericht Wuppertal HRB 11591 • Geschäftsführer: Dr. Stefan Borchers, Cahit Gürdal Ergüven
Always think green before printing!



Von: Bolz, Michael [mailto:michael.bolz@sap.com]
Gesendet: Sonntag, 29. Juni 2014 21:38
An: user@olingo.apache.org<ma...@olingo.apache.org>
Betreff: Re: AW: AW: Function import with annotations

Hi Stefan,

I think I have to take a deeper look into before I can complete answer your first question/thoughts  ;o)
But as I remember there were ideas to add an additional parameter (which contains all necessary information) to the "readData" method and extract the "DataStore" as separate interface which can be implemented (as mentioned some parts are in https://issues.apache.org/jira/browse/OLINGO-129 ).

To your second question. It seems you only forgot to add the function import to the entity container.
Just add:
                           List<FunctionImport> functionImports = new ArrayList<FunctionImport>();
                        functionImports.add(getFunctionImport(ENTITY_CONTAINER, FUNCTIONIMPORT_APPROVETASK_NAME));
                           entityContainer.setFunctionImports(functionImports);

To your "getSchemas()" method (see also attached source).

Can you please test the solution.

Kind regards,
Michael


From: <Roehrig>, Stefan <st...@vaillant-group.com>>
Reply-To: "user@olingo.apache.org<ma...@olingo.apache.org>" <us...@olingo.apache.org>>
Date: Freitag, 27. Juni 2014 16:01
To: "user@olingo.apache.org<ma...@olingo.apache.org>" <us...@olingo.apache.org>>
Subject: AW: AW: Function import with annotations

Hi Michael,

I think we have to use the annotation, because the processor needs to know about the optimization before it calls the datasource in order to provide the additional uri information.
As far as I understand the datasource interface, the Method “List<?> readData(EdmEntitySet entitySet)” is the only place which is relevant for handling $skip, $top, $filter, etc.

I attached the EdmProvider and the metadata.

Kind regards,
Stefan

--
Stefan Röhrig – Consultant Group IT - BPM

Vaillant Group IT
Tel. +49 2191 18 4725 • Mobile +49 175 2951 757 • Fax +49 2191 18 74725
E-Mail: stefan.roehrig@vaillant-group.com<ma...@vaillant-group.com>•http://www.vaillant-group.com<http://www.vaillant-group.com/>

Vaillant Group Business Services GmbH, Berghauser Str. 63, D-42859 Remscheid
Sitz: Remscheid • Registergericht: Amtsgericht Wuppertal HRB 11591 • Geschäftsführer: Dr. Stefan Borchers, Cahit Gürdal Ergüven
Always think green before printing!




Von: Bolz, Michael [mailto:michael.bolz@sap.com]
Gesendet: Freitag, 27. Juni 2014 15:43
An: user@olingo.apache.org<ma...@olingo.apache.org>
Betreff: Re: AW: Function import with annotations

Hi Stephan,

I have to agree with the two weaknesses.
To the first I also had an similar solution in mind, not with annotation but with an additional parameter in the "*Data" methods.
Unfortunately I didn't find the time to do a proof of concept for this.
And to the missing function imports I have to say the same   ;o(

For the case that you can do a contribution I support you as good as I can and afterwards I can commit it into Olingo.

To the last section, can you please provide me your "metadata" document and the code were you create the EDM model?
This would make it easier for me to help you ;o)

Kind regards,
Michael


From: <Roehrig>, Stefan <st...@vaillant-group.com>>
Reply-To: "user@olingo.apache.org<ma...@olingo.apache.org>" <us...@olingo.apache.org>>
Date: Freitag, 27. Juni 2014 15:32
To: "user@olingo.apache.org<ma...@olingo.apache.org>" <us...@olingo.apache.org>>
Subject: AW: Function import with annotations

Hello Michael,

Ok,I’ll try my best:
I think there are two serious weaknesses in the Annotation Processor:
1)      No possibility to optimize “List<?> readData(EdmEntitySet entitySet)”!
As far as I recognized, always the whole EntitySet has to be loaded, this is not acceptable in production environment (thousands or millions of entities!)
I would propose to introduce a new parameter for @EdmEntitySet:
@EdmEntitySet(optimizedRead=false):
This is the default in order to maintain compatibility. Method “List<?> readData(EdmEntitySet entitySet)” is used.
@EdmEntitySet(optimizedRead=true):
In this case $skip, $top, $filter, etc. is not handled by the annotation processor, but by a special method.
Proposed signature: Method “List<?> readData(EdmEntitySet entitySet, GetEntitySetUriInfo uriInfo)”
2)      Missing support for function imports.