mgreer wrote:
Looks like you have to saveOrUpdate the new entity Question to get it persisted, and stored in the Subject. I believe this is the documented behavior.
Is it causing a problem to use the second, working technique?
Documentation doesn't tell that you have to persist Child explicitly if you are using inverse="true" and cascade="all", my problem is i don't want to write
session.save(OrUpdate)(question),
This should work according to docs.
Question q = new Question();
q.setters are set
Subject s = load existing
s.addQuestion(q);
flush or commit
Regards and Thanks
Nirav