[
https://issues.apache.org/jira/browse/OLINGO-32?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13835363#comment-13835363
]
Michael Bolz commented on OLINGO-32:
------------------------------------
Hi Chandan,
first, thanks a lot for your thoughts and opinion and second, here are my
comments ;o)
# IMHO the parameters (IN, OUT, INOUT) are defined in CSDL but have no
relevance in the OData specification so that I did not add them to the
{{@Edm*}} annotations. Do you have an use case for them in the JPA processor?
Or can you provide/link to an example?
# Here it is IMHO similar to 1): The {{NONE}} is defined in CSDL but in OData
specification there exists no FunctionImports without a {{ReturnType}}. Hence I
did not add them. Can you please also take a look if you really need the
{{NONE}} return type in the JPA processor?
# Current Facet annotation has default values of 'maxlength = 0', 'scale = -1',
'precision = 0'. Hence we thought you use the default values as a sort of
marker for "not set value" and so we decided to set all default to a negative
('-1') value. Here we can discuss how the default is used and to what value we
will set them.
# Currently the annotations are based on the EDM defined in the OData
specification and are missing the in the CSDL defined "documentation". But I
think we can add a "Documentation" annotation or respectively re-use the
existing.
An sort of parser for the annotated Java classes exists in the
{{AnnotationEdmProvider}} class. Currently it did not have the feature you
want, but I'am sure that we (or someone ;o) ) can add it in the future.
As next step I would add an {{EdmDocumentation}} annotation, adapt the
{{EdmFunctionImport*}} annotations and set our annotations to {{@deprecated}}.
Then we have to take care that the JPA processor supports the old and the new
annotations for at least one version of Apache Olingo.
So that we can say:
* Apache Olingo 1.0 -> JPA annotations
* Apache Olingo 1.1 -> JPA and EDM annotations
* Apache Olingo 1.2 -> EDM annotations
IMHO this is ok, because the migration from the {{JPA}} to the {{EDM}}
annotations should be straight forward (actually _search and replace_). What do
you think?
Kind regards,
Michael
> Introduce (Java) Annotations for definition of EDM
> --------------------------------------------------
>
> Key: OLINGO-32
> URL: https://issues.apache.org/jira/browse/OLINGO-32
> Project: Olingo
> Issue Type: New Feature
> Affects Versions: V2 1.1.0
> Reporter: Michael Bolz
> Assignee: Michael Bolz
> Priority: Minor
> Fix For: V2 1.1.0
>
>
> The idea is to create your model as POJOs which then can be annotated with
> special {{@EdmXXX}} (Java) annotations to define the EDM for an OData Service.
> Based on these annotation then the {{edmx}} document ({{$metadata}}) can be
> generated as well as a generic {{Processor}} ({{ODataSingleProcessor}}) for
> e.g. {{JSON}} can be written.
> As initial contribution and starting point for discussions about this feature
> a branch with name {{PocEdmAnnotationsExtension}} is created with a basic
> Proof of Concept.
--
This message was sent by Atlassian JIRA
(v6.1#6144)