Create a HasMany Smart Relationship

Hello, i have 4 databases : A, B, C, and D.
Database A is linked to B, B to C and C to D.
I would like to create the HasMany Smart relationship : A(DemandeLocation) belongs to B(PanierSession) and B has many C(PanierAnnonce) belongs to D(Annonce).
i’m stuck at the step where i put the const include.
And i can’t modify the database to link directly A to D.
I wanna get all the A rows linked to the D id.

Hi @Nivash_Godur :wave: I need more information for help you.
How do you declare your relations inside Sequelize models?
If you want to find location from demandelocation_id you need to

select form A where A.id = demandelocation_id join B join C join D
or
select form C where C.paniersessionId = select form A  where A.id = demandelocation_id join C

Hello,
select form A where A.id = demandelocation_id join B join C join D