Return-Path: X-Original-To: apmail-olingo-dev-archive@minotaur.apache.org Delivered-To: apmail-olingo-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2B7DD18BC2 for ; Mon, 25 Jan 2016 21:17:40 +0000 (UTC) Received: (qmail 9470 invoked by uid 500); 25 Jan 2016 21:17:40 -0000 Delivered-To: apmail-olingo-dev-archive@olingo.apache.org Received: (qmail 9414 invoked by uid 500); 25 Jan 2016 21:17:40 -0000 Mailing-List: contact dev-help@olingo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@olingo.apache.org Delivered-To: mailing list dev@olingo.apache.org Received: (qmail 9382 invoked by uid 99); 25 Jan 2016 21:17:39 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Jan 2016 21:17:39 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id CBFF72C1F58 for ; Mon, 25 Jan 2016 21:17:39 +0000 (UTC) Date: Mon, 25 Jan 2016 21:17:39 +0000 (UTC) From: "Mitko Kolev (JIRA)" To: dev@olingo.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (OLINGO-857) AnnotationEdmProvider generates unparsable EDM MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/OLINGO-857?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mitko Kolev updated OLINGO-857: ------------------------------- Summary: AnnotationEdmProvider generates unparsable EDM (was: Annotation processor generates unparsable edm) > AnnotationEdmProvider generates unparsable EDM > ---------------------------------------------- > > Key: OLINGO-857 > URL: https://issues.apache.org/jira/browse/OLINGO-857 > Project: Olingo > Issue Type: Bug > Components: odata2-annotation > Affects Versions: V2 2.0.5 > Environment: Java version 2 > Reporter: Mitko Kolev > Attachments: -Edm-model-with-namespaces.patch, ABCD.edmx, CDAB.edmx, long-description.txt > > > Using different namespaces for olingo annotated POJOs may produce unparsable queries. Here is how to reproduce: > * create model that uses 2 namespaces with navigation between entities, for example the entities {{A}} and {{B}} have namespace {{AB}}, the entities {{C}}, {{D}} have namespace {{CD}}. > {code} > @EdmEntityType(name = "A", namespace = "AB") > @EdmEntitySet(name = "AA") > class A { > @EdmKey > @EdmProperty > String id; > @EdmNavigationProperty(toMultiplicity = Multiplicity.ZERO_OR_ONE, toType = B.class) > B b; > } > @EdmEntityType(name = "B", namespace = "AB") > @EdmEntitySet > class B { > @EdmNavigationProperty(toMultiplicity = Multiplicity.MANY, toType = A.class) > List a; > } > @EdmEntityType(name = "C", namespace = "CD") > @EdmEntitySet(name = "CC") > class C { > @EdmKey > @EdmProperty > String id; > @EdmNavigationProperty(toMultiplicity = Multiplicity.ZERO_OR_ONE, toType = D.class) > D d; > } > @EdmEntityType(name = "D", namespace = "CD") > @EdmEntitySet > class D { > @EdmNavigationProperty(toMultiplicity = Multiplicity.MANY, toType = C.class) > List c; > } > {code} > * Now build the model with > {code} > new AnnotationEdmProvider(Arrays.> asList(A.class, B.class, C.class, D.class)); > {code} > * The query http://localhost/CC('1')/D results in > Attempt to parse these queries results in > {code} > org.apache.olingo.odata2.api.edm.EdmException: An exception occurred. > at org.apache.olingo.odata2.core.edm.provider.EdmEntityContainerImplProv.getAssociationSet(EdmEntityContainerImplProv.java:169) > at > ... > {code} > I guess the reason is that the default namespace container is generated in the wrong schema (the schema for the last entities in the list) > This issue is blocking our development. -- This message was sent by Atlassian JIRA (v6.3.4#6332)