'Difference between specifying entity and specifying only id in Typeorm relations

I want to know how typeorm treats specifying id and specifying entity instance while doing relationship but both works in many conditions. For instance

 @ManyToMany(() => SoldItemEntity, (solditem) => solditem.id)
 soldItem: SoldItemEntity;

 @ManyToMany(() => ClientEntity, (client) => client.id)
 @JoinTable()
 client: ClientEntity;

or

 @ManyToMany(() => SoldItemEntity, (solditem) => solditem.client)
 soldItem: SoldItemEntity;

 @ManyToMany(() => ClientEntity, (client) => client.solditem)
 @JoinTable()
 client: ClientEntity;


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source