posted 10 years ago
Hey,
As while sending the object to business or presentation layer, we get the object detached from session and persistence context associated is destroyed.
I think, in hibernate, we should be able to achieve the updation of only modified column in following way -
By setting select-before-update option along with dynamic update to true. In this scenario, Hibernate will at first fire a select query to retrieve the record and check if data in bean has been updated ( by select-before-update) and if data has been updated then update query of selected column will be fired (by dynamic update).
Personally I would not recommend this approach.As these will add additional overhead by firing addition queries to check whether the state of object has changed. As you are working on a web-application, I would recommend using javascript and pointing out the changed records as soon as change happens in presentation layer and persisting only the changed records. This approach would provide you optimum performance.
Regards
Salil Verma