Hi,
I have an issue that I can't find any solution or workaround.
My problem is the following.
I have a STATELESS EJB which is called to persist an entity.
The first step of the method is to get the correct object (entity) from the DB by:
Code:
Foo lFoo = entitymanager.find(1,Foo.class).
Then I try to change one of the relationship entity like this:
Code:
lFoo.setBar(entitymanager.fin(1,Bar.class));
With the debugger, I can see the good bar object in lFoo. (In fact, a javassist of the object)
But when I try to save lFoo, I get an error from DB claiming that null is passed to bar value.
I try to do;
Code:
lFoo.setBar(new Bar);
And I get the classical error 'save the transient before flushing' which is great, so I clearly do not understand why Hibernate did not save the correct value in the first example.
I spent my last week-end on that and I have no more idea to deal with that issue.
If somebody have any clue that I can follow...
Thanks everyone,
Aubertinp