wood burning stoves 2.0*
The moose likes Object Relational Mapping and the fly likes Null date merge problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Null date merge problem" Watch "Null date merge problem" New topic
Author

Null date merge problem

Neha Mahajan
Greenhorn

Joined: Apr 22, 2008
Posts: 7
While persisting(merge) an entity, I try to update a date column with a null value. This is not happening and the old value is only retained. I'm using EJB 3.0 with JPA. How do I update my date columns with null?
James Sutherland
Ranch Hand

Joined: Oct 01, 2007
Posts: 553
How (exactly) are you setting the date to null and merging the object? What JPA provider are you using?

Check the managed object after the merge and confirm that its date has been set to null. Also if the date was null to begin with, nothing may need to be updated. Can you update other attributes of the object? Do any errors occur?

TopLink : EclipseLink : Book:Java Persistence : Blog:Java Persistence Performance
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Null date merge problem
 
Similar Threads
Regarding HttpSession
Hibernate cache problem?
JDBC
I want to merge an instance that doesn't pass database validation
Cannot perform SQL UPDATE null