Hello,
I'm using EclipseLink 2.4.0 with MongoDB 2.2.
I've got a Entity which has a @OneToMany relation to itself :
@Entity
@NoSql(dataType="userGroup", dataFormat=DataFormatType.MAPPED)
public class Group extends JPAMongoBaseEntity {
@Id
@Field(name="_id")
@GeneratedValue
private String id;
// Only the direct subGroup are set (not the subGroup of the subGroup)
@OneToMany(targetEntity=Group.class, fetch=FetchType.LAZY, cascade=CascadeType.REMOVE)
@Field(name="directSubGroups")
private List<Group> directSubGroups = new ArrayList<>();
...
When I use this relation, items added to the relation - entity.getDirectSubGroups().add(...) are correctly send to database.
but when EclipseLink retrieve the entity from database, the relation is always empty.
So the next add will override the previous and only the last .add() will persist.
Any help will be greatly appreciated.