title: Postgres / TypeORM - multiple joins. How should I format the query?
body: <p>I am building a backend microservice which uses postgres as DB and TypeORM (NodeJs) library to manage connections with it.</p>
  
  <p>Imagine that my db contains 3 tables / entities.</p>
  
  <ol>
  <li>User table (primary column is - id)</li>
  <li>Profile table (primary column id, then foreign key user_id pointing to user tables id column)
  There might be multiple profile rows linked to one user</li>
  <li>Experience table (primary column id, then foreign key profile_id column pointing to profile table id column)
  There might be multiple experience rows linked to one profile</li>
  </ol>
  
  <p>a) Can I perform one complex query to get profile row &amp; all experience rows linked to it?</p>
  
  <pre><code>  getFullProfile(profileId: number) {
      return this.profileEntityRepository.createQueryBuilder('profile')
        .where('profile.id = :profileId', { profileId })
        .innerJoinAndMapMany('profile.experience', ExperienceEntity, 'experience', 'experience.id = profile.id')
        .getOne();
    }
  </code></pre>
  
  <p>Sadly this does not return any results (it does if I comment out innerJoinAndMapMany line).</p>
  
  <p>Any suggestions? It doesn't have to be TypeORM api based answer, simple plain query would be sufficient.</p>
  
  <p>Thanks!</p>