You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Michael Bolz (JIRA)" <ji...@apache.org> on 2013/11/22 08:44:55 UTC

[jira] [Comment Edited] (OLINGO-32) Introduce (Java) Annotations for definition of EDM

    [ https://issues.apache.org/jira/browse/OLINGO-32?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13829722#comment-13829722 ] 

Michael Bolz edited comment on OLINGO-32 at 11/22/13 7:42 AM:
--------------------------------------------------------------

With the last [commit|https://git-wip-us.apache.org/repos/asf?p=incubator-olingo-odata2.git;a=commit;h=4d80947e511a900383315c08c2b7ae9826470840] (on this branch, id: {{4d80947e511a900383315c08c2b7ae9826470840}}) the {{@EdmNavigationProperty}} annotation was simplified/refactored.
The {{@NavigationEnd}} was removed and all properties are now _optional_. Hence, all not set properties will be automatically generated by the {{AnnotationEdmProvider}}.

With this change it is now possible to create a {{EdmEntityType/EdmEntitySet}} with just a few annotations, e.g.:

{code}
@EdmEntityType(namespace="MyNamespace")
@EdmEntitySet
public class SampleEntity {
  @EdmKey
  @EdmProperty
  private int id;
  @EdmProperty
  private String someName;
  @EdmNavigationProperty
  private AnotherEntity relatedEntity;
}
{code}

Current thoughts are to make the {{namespace}} at the {{@EdmEntityType}} also an optional parameter.
If not set a default namespace will be used. As suggestion: Automatically generated based on the package name of the class.

Some opinions about that change?

Kind regards,
Michael  


was (Author: mirbo):
With the last [commit|https://git-wip-us.apache.org/repos/asf?p=incubator-olingo-odata2.git;a=commit;h=4d80947e511a900383315c08c2b7ae9826470840] (on this branch, id: {{4d80947e511a900383315c08c2b7ae9826470840}}) the {{@EdmNavigationProperty}} annotation was simplified/refactored.
The {{@NavigationEnd}} was removed and all properties are now _optional_. Hence, all not set properties will be automatically generated by the {{AnnotationEdmProvider}}.

With this change it is now possible to create a {{EdmEntity/EdmEntitySet}} with just a few annotations, e.g.:

{code}
@EdmEntity(namespace="MyNamespace")
@EdmEntitySet
public class SampleEntity {
  @EdmKey
  @EdmProperty
  private int id;
  @EdmProperty
  private String someName;
  @EdmNavigationProperty
  private AnotherEntity relatedEntity;
}
{code}

Current thoughts are to make the {{namespace}} at the {{@EdmEntity}} also an optional parameter.
If not set a default namespace will be used.

Some opinions about that change?

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)