When defining keys you are always providing the mapping for the primary key fields of the current entity. If the mapping happens to be a foreign key mapping the columns will be added to the related entity's table.