We're trying to do a @OneToMany and @ManyToOne relation with EclipseLink/MongoDB:
The @OneToMany declaration looks like this:
@Entity
@NoSql(dataType = "ServiceCatalog", dataFormat = DataFormatType.MAPPED)
public class ServiceCatalog {
@Id
@GeneratedValue
@Field(name = "_id")
private String id;
@OneToMany
private List<ServiceCatalogNeedCategory> serviceCatalogNeedCategories;
…
On the other side, the @ManyToOne declaration:
@Entity
@NoSql(dataType = "NeedCategory", dataFormat = DataFormatType.MAPPED)
public class ServiceCatalogNeedCategory {
@Id
@GeneratedValue
@Field(name = "_id")
private String id;
@Field(name = "title")
private String Title;
@ManyToOne(fetch=FetchType.LAZY)
private ServiceCatalog serviceCatalog;
...
The above configuration leads to the following error: org.eclipse.persistence.eis.mappings.EISOneToOneMapping cannot be cast to org.eclipse.persistence.mappings.OneToOneMapping
We really need to be able to resolve both directions.
Cheers Michael