Hi Guys,
I have Worker object which has child object State. State is a reference table (hence mutable="false" in the mapping file).
Now when I want to create Worker, I am doing something like this
Worker worker = new Worker()
State state = new State();
state.setId(1);
worker.setState(state );
and then
das.saveOrUpdate(worker);
But when I print any value of State other than Id, I am getting null.
e.g. worker.getState().getAbbr() ---> this gives null
Does anyone know the reason. Am I wrong somewhere.
I know that I can always do findBy on State first and then set it. But I want to avoid extra findBys.
Can someone let me what should I do to fix this.
_________________ Regards,
Mahen
http://www.discoverabout.net
http://funnfacts.discoverabout.net
|