posted 2 years ago
I have a class like this:
The child class and therefore the child table has no references to Parent. Now the problem is that I have code like:
The problem here is that if I don't find the child and try to save I get the error: "object references an unsaved transient instance - save the transient instance before flushing"
If I set CascadeType.PERSIST then it works when a brand new child but when I find the child in the DB and it is detached then I get the error: "detached entity passed to persist".
Anyway to make it work without explicitly saving child first?
Thanks,<br />Salil Surendran