[
https://issues.apache.org/jira/browse/OLINGO-245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13975095#comment-13975095
]
Chandan V.A commented on OLINGO-245:
------------------------------------
Hi,
the issue is fixed now. The issue was occurring due to name conflicts between
the entity property representing the foreign key and the navigation property.
Now the entity property representing foreign key will be prefixed with FK_.
I hope this solves the issue.
Commit - ID - 2dd0181d4fce203d6cf4e67367b25ffe54540340
Thanks
Kind Regards
Chandan
> Wrong EDM property type when setDefaultNaming is false
> ------------------------------------------------------
>
> Key: OLINGO-245
> URL: https://issues.apache.org/jira/browse/OLINGO-245
> Project: Olingo
> Issue Type: Bug
> Components: odata2-jpa
> Affects Versions: V2 1.2.0
> Reporter: Ruslan Stelmachenko
> Assignee: Chandan V.A
> Fix For: V2 1.3.0
>
> Attachments: apache-olingo-tutorial.zip
>
>
> If I set {{ODataJPAContext.setDefaultNaming(false)}} then simple request stop
> working:
> http://localhost:8080/olingo.odata2.sample.cars.web/MyODataJPA.svc/Productss
> with this error:
> {quote}
> java.lang.ClassCastException
> org.apache.olingo.odata2.core.edm.provider.EdmSimplePropertyImplProv cannot
> be cast to org.apache.olingo.odata2.api.edm.EdmNavigationProperty
> org.apache.olingo.odata2.core.ep.aggregator.EntityInfoAggregator
> createNavigationInfoObjects 383
> {quote}
> *The problem in ManyToOne fields.*
> I debug a little and realized that method
> {{org.apache.olingo.odata2.core.ep.aggregator.EntityInfoAggregator.createNavigationInfoObjects}}
> receiving {{propertyNames}} list with propery names that already in
> {{edmProperties}} as {{EdmSimplePropertyImplProv}}. But if I set
> {{ODataJPAContext.setDefaultNaming(true)}} then the same method receiving
> list with navigation propery names as *JpaEntityClassNameDetails* so the
> names are different and all working fine.
> I dont know how to fix this but because of this behavior we can't just use
> {{ODataJPAContext.setDefaultNaming(false)}} for ManyToOne fields.
> I attach a simple maven project with my Entities and simple servlet for run
> in tocmat. Problematic entity is {{Products}}.
--
This message was sent by Atlassian JIRA
(v6.2#6252)