0
votes

If a put a @embedded in Toto class for example:

public class Titi {

 private String name;
 @embedded
 private Toto toto;

}

I can't do this :

public List getAll() {

    ds = MongodbUtil.getDataStore();
    List<Toto> entities = ds.find(Toto.class).asList();
    for (Toto t: entities) {
        System.out.println("t  : "  +  t.toString());
    }
    return entities;
}

Toto is not an object anymore ?

2nd, how can i handle the famous "hibernate" Lazy in morphia to delete a titi concerned when i delete a toto

Not very good at english !

Thanks everybody.

1

1 Answers

0
votes

You'll have to issue (at least) 2 different delete calls. Cascading deletes is not something that's supported. Another option is to embed all the Titi objects inside the Toto you're trying to delete.