6.2.1. Collection foreign keys
Collection instances are distinguished in the database by the foreign key of the entity that owns the collection. This foreign key is referred to as the collection key column (or columns) of the collection table. The collection key column is mapped by the <key> element.
There may be a nullability constraint on the foreign key column. For most collections, this is implied. For unidirectional one to many associations, the foreign key column is nullable by default, so you might need to specify not-null="true".
<key column="productSerialNumber" not-null="true"/>
The foreign key constraint may use ON DELETE CASCADE.
<key column="productSerialNumber" on-delete="cascade"/>
See the previous chapter for a full definition of the <key> element.