I am using Morphia 2.x, and I have a usecase where i want to save 1 Entity class into 2 different Collections.
However Morphia 2.x save method doesn't have any option to pass a Collection Name, Where as Morphia 1.x had this option.
I am not sure why they have removed this option.
@Entity
public class Unit {
@Id
private String id;
protected Unit() {
}
public String getId() {
return this.id;
}
public void setId(final String id) {
this.id = id;
}
}
Morphia 2.3 will reintroduce this functionality as an option passed via the
alternateCollectionoption onInsertOneOptions(among other options classes). I'm working to get this out soon.