Lack of many-to-one associations in OData Feed (olingo)

I built an OData Producer based on apache olingo, JPA, and mySQL following this tutorial . While many-to-many associations are displayed inside the OData feed, many-to-one associations are not displayed at all (nor their visible JOIN columns )

Does anyone have an idea how to get olingo to display these associations?

+4
source share
2 answers

Since 2.0.0 [ http://olingo.apache.org/download.html] release of the Olingo V2 lib, it is not necessary to comment on the relationship property with either the name or the name ColumnName.

See the JIRA issue for more details - https://issues.apache.org/jira/browse/OLINGO-127 .

Relationship Chandan

+2
source

We had the same problem. It turns out olingo did not get the correct link name for the column correctly, so we had to set it manually in all our associations.

eg.

@ManyToOne(fetch=FetchType.LAZY)    
@JoinColumn(name="AccountId")
public Account account;

becomes

@ManyToOne(fetch=FetchType.LAZY)    
@JoinColumn(name="AccountId", referencedColumnName = "Id")
public Account account;
+2
source

Source: https://habr.com/ru/post/1539549/


All Articles