I built a OData Producer based on apache olingo, JPA and mySQL following this tutorial While many-to-many associations are displayed within the OData Feed, many-to-one associations are not displayed at all (neither are their JOIN-columns visible)

Does anyone have an idea, how to get olingo to display those Associations?

有帮助吗?

解决方案

With 2.0.0 [http://olingo.apache.org/download.html] release of Olingo V2 lib, it is not mandatory to annotate the relationship property with both name and referencedColumnName.

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

Regards Chandan

其他提示

We had the same problem. Turns out olingo wasn't getting the default referencedColumnName correctly, so we had to set it manually on all our associations.

e.g.

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

Becomes

@ManyToOne(fetch=FetchType.LAZY)    
@JoinColumn(name="AccountId", referencedColumnName = "Id")
public Account account;
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top