olingo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Ammer (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (OLINGO-1167) Pojogen fails when resource has same name as primitive type
Date Mon, 21 Aug 2017 12:33:00 GMT

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

Simon Ammer edited comment on OLINGO-1167 at 8/21/17 12:32 PM:
---------------------------------------------------------------

I created a pull request: https://github.com/apache/olingo-odata4/pull/22


was (Author: lynx):
I created a pull reques: https://github.com/apache/olingo-odata4/pull/22

> Pojogen fails when resource has same name as primitive type
> -----------------------------------------------------------
>
>                 Key: OLINGO-1167
>                 URL: https://issues.apache.org/jira/browse/OLINGO-1167
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata4-commons, odata4-ext
>    Affects Versions: (Java) V4 4.2.0, (Java) V4 4.3.0
>         Environment: EntityType with same name as EdmPrimitiveTypeKind. For instance:
Binary
>            Reporter: Simon Ammer
>            Priority: Critical
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> At some parts Olingo does not use the fully qualified name of a resource to reference
it.Therefore _pojogen_ fails when you have a resource with the same name as a value defined
in [EdmPrimitiveTypeKind.java|https://github.com/apache/olingo-odata4/blob/6bc17b668c16bbf96458c996bb9d9a768c74dc98/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/EdmPrimitiveTypeKind.java].
Take the following scenario:
> *$metadata*
> {code:xml}
> ...
> <EntityType Name="Binary">
>   <Property Name="asset" Type="Edm.Int64"/>
>   <Property Name="version" Type="Edm.Int64"/>
>   <Property Name="type" Type="Edm.String"/>
>   <Property Name="format" Type="Edm.String"/>
> </EntityType>
> ...
> {code}
> My {{self.edu.Binary}} resource match with the primitive kind {{Edm.Binary}} due to the
check in [EdmTypeInfo.java|https://github.com/apache/olingo-odata4/blob/4a51d16425144a7de0be0f9dcd01c667bed322df/lib/commons-core/src/main/java/org/apache/olingo/commons/core/edm/EdmTypeInfo.java#L107]:
> {code:java}this.primitiveType = EdmPrimitiveTypeKind.valueOf(this.fullQualifiedName.getName());{code}
> When the code generator tries to access the type of the entity it throws a NullPointerException.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message