The relationship of two classes A and B is like the this:
A*-->1B
A many to one B.
Some A is associated with a B.
I can invoke A.getB() to obtain B.
When a B is deleted, all A associated with this B should be set null.
So null should be return when A.getB() is invoked.
But now after A was deleted, all A can not load from database with errors.
How could I do about it??
My hbm.xml like the following:
<class discriminator-value="A" name="A" table="A" >
...
<many-to-one class="B" name="b" />
..
</class>
|