'How I select Three entity with FindOptions in TypeORM?

I have 3 entities.

  1. Sale
  2. SalePrice
  3. Product

enter image description here

Sale is a discount event. Various products are on sale at the event.

Not all products are eligible for the discount event.

When selecting a product, if the product is subject to a discount event (Sale Price) The price of the product should be sale price, and if it is not subject to discount event, Must be commonPrice.

I want get allProducts price with find options. I use OneToMany and ManyToOne in Sale and SalePrice, Product but it returns null. How I can get it?



Sources

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

Source: Stack Overflow

Solution Source