This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Hibernate not updating a null column Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate not updating a null column" Watch "Hibernate not updating a null column" New topic
Author

Hibernate not updating a null column

Lisa Ray
Greenhorn

Joined: Mar 05, 2009
Posts: 22
Hi All,
I've a DB table which has several columns. Hibernate can't update a DB row when a nullable column is null and through code I try to set it to a legal non-null value. That said, if the nullable column has a legal vale, Hibernate successfully updates its value. I can see the Hibernate generated UPDATE SQL in the log. Furthermore, while updating a nullable column which is null, Spring's Hibernate template doesn't return from saveOrUpdate() method call. In the log there's no exception. Seems like the exception is gets lost. Did anyone face the same issue?

Here's how it looks in code.


Service Layer


DAO Layer



What's happening here?
When I try to debug the app, it's strange to note that the control disappears after the saveOrUpdate call. The control never returns from the save method. Also, in the log file I can't see any exception propagated.


Thanks
Lisa
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate not updating a null column
 
Similar Threads
Both saveOrUpdate and merge won't work
Differences among save,update,saveorupdate,merge method in session object?
Need some input/tutorial on Hibernate Internals
Save Or Update In Hibernate Always Updating
Unable to locate current JTA transaction error