title: Cannot query across one-to-many for property NestJS and TypeORM
body: <p>I have two entities one is <code>car</code> and another one is <code>carAvailability</code></p>
  <pre><code>import { Entity, Column, PrimaryGeneratedColumn, OneToMany } from 'typeorm';
  import { CarAvailability } from 'src/car-availabilitys/car-availability.entity';
  
  @Entity('cars')
  export class Car {
    @PrimaryGeneratedColumn()
    id: number;
  
    @Column()
    name: string;
  
    @OneToMany(() =&gt; CarAvailability, (carAvailability) =&gt; carAvailability.car, {
      eager: true,
      cascade: true,
    })
    availabilities: CarAvailability[];
  }
  </code></pre>
  <p>I am trying to add a service that queries and filters cars based on the availabilities. In My Service and tried two ways:</p>
  <p>Method 1 with repo functions:</p>
  <pre><code>async test () {
    const startDateTime = '2012-04-24 02:25:43.511';
  
    return await this.repo.find({
      relations: ['availabilities'],
      where: {
        availabilities: {
          start_date_time: startDateTime
        }
      }
    });
  }
  </code></pre>
  <p>Method 2 with query builder:</p>
  <pre><code>async test () {
    const startDateTime = '2012-04-24 02:25:43.511';
  
    return this.repo.createQueryBuilder('cars')
      .innerJoin('cars.availabilities', 'car_availabilities')
      .where(&quot;cars.availabilities.start_date_time = :startDateTime&quot;, { startDateTime })
      .getMany();
  }
  </code></pre>
  <p>Method 1 error:</p>
  <pre><code>Error: Cannot query across one-to-many for property availabilities
  </code></pre>
  <p>Method 2 error:</p>
  <pre><code>QueryFailedError: missing FROM-clause entry for table &quot;availabilities&quot;
  </code></pre>
  <p>I feel like I am missing something but I am not sure. Have referred both NestJS and TypeORM docs but can't seem to figure out what went wrong.</p>