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

Chandan V.A commented on OLINGO-42:
-----------------------------------

Hi Georgi
The OData2-JPA processor now does not require a JPA entity to define a property 
in addition to the property that is annotated with JoinColumn annotation (for 
many to one relationship). However following will be the constraints

# Support for JoinColumns yet to be implemented
# ReferenceColumnName attribute is still mandatory
# property annotated with JoinColumn will be added to the EDM. However such 
properties cannot be updated or modified using OData request. In other words 
the property is read only. The property displays following values
 ## Null -> In case the entity is not yet related to the other entity.
 ## Non Null -> In case a link is created explicitly via HTTP POST on $links or 
HTTP POST/PUT on the entity with links to related entity (link tag in Entry)

I have created a separate JIRA issue for supporting JoinColumns and handling 
cases where ReferenceColumnName is left optional.

Please Note that the processor library also supports JPA entities that define 
redundant property for properties annotated with JoinColumn annotation.

I would like to close this JIRA issue. Please reopen in case you have more 
suggestions.

Regards
Chandan

> jpa processor requires a redundant field for many-to-one relationships
> ----------------------------------------------------------------------
>
>                 Key: OLINGO-42
>                 URL: https://issues.apache.org/jira/browse/OLINGO-42
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata2-jpa
>    Affects Versions: V2 1.0.0
>         Environment: windows7, tomcat 7.0.42, hsql, eclipse link 2.5.0
>            Reporter: Georgi
>            Assignee: Chandan V.A
>             Fix For: V2 1.1.0
>
>
> It looks like that the only way to get a consistent EDM associations model 
> and the corresponding navigation properties, when there are many-to-one 
> (bi-directional) managed relationships, is to add an additional and redundant 
> property, annotated with @Column to the owning class. Same as in your 
> reference jpa model.
> However, it's highly unlikely that one models a JPA model like this in 
> reality and quite an impairment particularly for existing models.
> I'm not sure why is that needed, because the information encoded in the 
> required field @Column annotation is redundant with the one @JoinColumn 
> annotation and you already parse the JoinColumn anyways.
> So probably that's a low hanging fruit?
> I also realized that specifying the optional in the JPA @JoinColumn 
> annotaiton property referencedColumnName is yet another mandatory requirement 
> for the JPA edm producer to create a valid navigation properties set.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to