Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I want to merge an instance that doesn't pass database validation

 
Tony Ennis
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.)



 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic