Forums Register Login

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

+Pie Number of slices to send: Send
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.)



brevity is the soul of wit - shakepeare. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 753 times.
Similar Threads
org.hibernate.PersistentObjectException: detached entity passed to persist:
MyFaces / JSF problem in OC4J
hibernate : @Version and merge
Need to understand session.merge()
One-To-Many collection not updating
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 15, 2024 22:54:25.