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/05/26 13:45:38 UTC

Processing of annotations

Hi,

after implementing an odata service manually with Olingo I try to understand how to do it with annotations.

I understood how to annotate java beans and how the edm is created automatically based on the annotations.

What I can't understand is how the annotation processor knows which class and methods to use to retrieve the payload data.

Could you help, please?

Regards,

Stefan Röhrig

AW: Processing of annotations

Posted by "Roehrig, Stefan" <st...@vaillant-group.com>.
Hi Michael,

I tried hard to understand the architecture and I’m really confused about which classes are in the core library and which are in the reference implementation.

In a framework I would expect to have a look at the reference implementation, see what happens there and implement my own application.
For this task I would expect to use api classes and interfaces only.
I wouldn’t expect classes for the reference implementation in the core library.

Now I think I have to do the following steps:
1.)
I can’t use the api class AnnotationServiceFactory, because it is specific for usage with core class AnnotationInMemoryDs, which is useful for reference implementation only.
2.)
Instead I have to implement my own version of core class AnnotationServiceFactoryImpl and I have to provide my own implementation of the core interface DataSource.
3.)
I can reuse the core class AnnotationEdmProvider, because it is generic.
4.)
I can reuse the core class AnnotationValueAccess, because it is generic.

Is this correct?
Could you explain the parameters and return values of the interface DataSource, please?

Thanks for your help,
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: mibo.asap@gmail.com [mailto:mibo.asap@gmail.com] Im Auftrag von Michael
Gesendet: Montag, 26. Mai 2014 13:58
An: user@olingo.apache.org
Betreff: Re: Processing of annotations

Hi Stefan,

the basic combination of "ListsProcessor" get the information which e.g. "Entity" is requested and then delegates to the "AnnotationInMemoryDs" which internally has a "DataStore" for each before annotated java bean (POJO).
The payload data then is read via reflection based on the e.g. "@EdmProperty" annotation at the java bean fields.

This architecture is also documented in our wiki: https://wiki.apache.org/Olingo/Documentation/AnnotationProcessor

Do you need more help to understand the concept?

Kind regards,
Michael


On Mon, May 26, 2014 at 1:45 PM, Roehrig, Stefan <st...@vaillant-group.com>> wrote:
Hi,

after implementing an odata service manually with Olingo I try to understand how to do it with annotations.

I understood how to annotate java beans and how the edm is created automatically based on the annotations.

What I can’t understand is how the annotation processor knows which class and methods to use to retrieve the payload data.

Could you help, please?

Regards,

Stefan Röhrig


Re: Processing of annotations

Posted by Michael <mi...@apache.org>.
Hi Stefan,

the basic combination of "ListsProcessor" get the information which e.g.
"Entity" is requested and then delegates to the "AnnotationInMemoryDs"
which internally has a "DataStore" for each before annotated java bean
(POJO).
The payload data then is read via reflection based on the e.g.
"@EdmProperty" annotation at the java bean fields.

This architecture is also documented in our wiki:
https://wiki.apache.org/Olingo/Documentation/AnnotationProcessor

Do you need more help to understand the concept?

Kind regards,
Michael



On Mon, May 26, 2014 at 1:45 PM, Roehrig, Stefan <
stefan.roehrig@vaillant-group.com> wrote:

>  Hi,
>
>
>
> after implementing an odata service manually with Olingo I try to
> understand how to do it with annotations.
>
>
>
> I understood how to annotate java beans and how the edm is created
> automatically based on the annotations.
>
>
>
> What I can’t understand is how the annotation processor knows which class
> and methods to use to retrieve the payload data.
>
>
>
> Could you help, please?
>
>
>
> Regards,
>
>
>
> Stefan Röhrig
>