@OneToMany and @ManyToOne in MongoDB and JPA -EISOneToOneMapping cannot be cast to [message #1064146] |
Mon, 17 June 2013 15:55  |
Eclipse User |
|
|
|
Hi all!
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.
Thanks foryour help.
Cheers Michae
|
|
|
|
Powered by
FUDForum. Page generated in 0.03868 seconds