In the one-to-one association using a primary key association example on page 223 of "Hibernate In Action", the one between user and address, how do I get the address to be deleted?
Let's say I create a user, give it an address and call save. Hibernate inserts the user into the user table and the address into the address table. Now, let's say the user becomes homeless. How do I get the address to be deleted? If I do user.setAddress(null), Hibernate does nothing. How do I get Hibernate to recognize that the other-end of the association, the address, is gone and must be deleted?
|