I have a class like this (with getters and setters, all mapped to hibernate, each with a sequence to oracle DB)
public class A{
private B b;
private C c;
}
i'm creating this object and saving it to the database.
So i create an A object and populate it with a B object and call
saveOrUpdate(a)
so i can have "a" and "b" sequences generated. then i do some calculations and create an instance of "C" and set it to "a"
Up to here, everything works great. I now need to get "c"'s id so i do some checks before i flush and commit.
But saveOrUpdate won't work here because the object is no longer transient. According to hibernate docs on saveOrUpdate: "if the object is already persistent in this session, do nothing "
Any ideas?
(can't post the code because it's too long and messy, but it's basically that)