Hi,
I have two POJOs: Login and Alias. They have one-to-one association between them.
So Login has field:
Code:
Alias alias
and Alias has field:
Code:
Login login.
Now let's assume that we are updating the Login record. When Alias field is blank in the UI, I want to delete the corresponding Alias from the database.
I am calling
Code:
login.setAlias(null);
But it does not delete the record from the database.
I am using the following mapping in Login.hbm.xml
Code:
<one-to-one name="alias" class="com.sungard.cs.admin.login.Alias" property-ref="login" cascade="save-update" />
Any help! Thanks in advance.