Mar 25th, 2009, 06:24 PM
avoiding org.hibernate.PropertyValueException not-null property references ...
This may be a Hibernate related question and not Spring.
I have an Object A which has a OneToOne B. In the UI, I'll choose B from a select listbox and set it to A. Now, we can write converters which loads a hibernate session or entityManager, get the record by id etc. But I don't want to make roundtrips to the database, especially when you have selectListItems in a datagrid. (Crazy!)
I'd like to write a simple converter that just creates java objects (of B) that sets the corret id. (since you already have that once the object is loaded), set it to A and then save A. Currently, Hibernate throws this error:
on persist or merge
org.hibernate.PropertyValueException: not-null property references a null or transient value: B