Domanda

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?

È stato utile?

Soluzione

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

Altri suggerimenti

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;
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top