nvmurali wrote:
I'd like to know how is it possible to delete the awards when a user is deleted?
Since you have a unidirectional mapping, there is no way to cascade deletions from User to Awards. You need to manually remove the associations from the Awards table corresponding to the User being deleted. Doing a Query like
Code:
from Awards where user = :user
get the set of Awards, and make those users null.
nvmurali wrote:
Newbie question:
For every column that is mapped in the hbm file, does there need to be a getter/setter for it (I know there needs to be, but is there a way not to?). The reason I ask is, by declaring the relationship in Awards, but nothing in user, I don't see how Hibernate will know there is a relationship between User & Awards.
No need, if the access method is set to field, then there is no need for getter/setters. They are required only if the access method is set to property. But I dont see how thats connected to your question. You are only doing a unidirectional mapping, so there is no way for Hibernate to know the association from the other side[/code]