Hello
I am getting the following exception thrown in a validator when I query the db for the existence of an entity A.
Code:
Caused by: org.hibernate.PropertyValueException: not-null property references a null or transient value: B
at org.hibernate.engine.Nullability.checkNullability(Nullability.java:72)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:284)
The validator basically searches for the entity A by unique string code to ensure it doesnt exist.
If I do not set object B on A before calling the validator, the validator *doesn't* throw the error and the object is persisted correctly.
A hbm MappingCode:
<set
name="B"
cascade="all-delete-orphan">
<key column="ID" />
<one-to-many class="B" />
/>
</set>
How can I run validators like this without getting this transient exception?
Is this a problem in our design?
Any thoughts appreciated?
regards
JC