This is a relevant feature of composite ID. The key of the Map type should be the composite id (embedded) when the subentity collection references the aggregate root with the composite id.