I want to merge an instance that doesn't pass database validation
posted 6 years ago
I have a detached hibernate model instance. It's brand new and has never been persisted. One of the attributes is null. When I attempt to merge() the row, I get a "not-null property references a null or transient value" exception. That's a correct error message.
(this is a web app, the user has to fix and re-submit the data)
But I can't fix the null attribute until I merge() it - and if I don't merge(), I get 'lazy load' exceptions.
Is there a merge()-lite that works for unpersisted rows?
(This is a highly sanitized description of course. There are many technical issues and many other technical approaches.)