|Merge with Null being ignored [message #872808]
||Wed, 16 May 2012 21:36
| Mauro Flores
Registered: September 2009
When I set null to properties of an entity and call merge, the value of the column is not changed to null. If I set any other value the changing happens.|
// EJB method
Foo foo = em.find(Foo.class, 1);
Foo fooMerge = em.merge(foo);
Foo fooMerge = <call ejb method>;
System.out.println("Foo merge:" + fooMerge.getName()); // prints null
Foo fooFind = em.find(1);
System.out.println("Foo find:" + fooMerge.getName()); // prints the original value of name
This happens with an specific entity.
I can't see anything different from this entity to the others.
The field is not Transient. The merge runs inside an EJB method(CMT) running on weblogic. When I run the equivalent code standalone, the null is updated correctly.
I used to see it a lot using Openjpa implementation, but this is the first time with Eclipselink.
I appreciate some help.
[Updated on: Wed, 16 May 2012 21:40]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.03526 seconds