We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I use subqueries and pagination I get the error Cannot get entity metadata for the given alias ...
List of entities
TypeORMError: Cannot get entity metadata for the given alias ....
`@Entity() export class T1 {
@PrimaryGeneratedColumn() id: number @Column({ nullable: true }) name: string; @OneToMany(type => T2, t2 => t2.t1) t2s: T2[];
} `
` @entity() export class T2 {
@PrimaryGeneratedColumn() id: number @Column({ nullable: true }) name: string; @ManyToOne(() => T1) @JoinColumn({ name: 'idt1' }) t1?: T1;
}`
let qb = this.dataSource.createQueryBuilder() .select('t2') .from(T2, 't2') .innerJoin((subquery: SelectQueryBuilder<T1>) => { return subquery. select('t1.id', 'id') .addSelect('t1.name', 'name') .from(T1 , 't1'); }, 's', 't2.idt1 = s.id') .orderBy('s.name') .take(10).skip(0);
const data = await qb.getManyAndCount();
Without take(10).skip(0) everything works fine. I know that t1 can be added without a subquery. This example is for demonstration purposes.
Typeorm: 0.3.20 Operating System: Linix Node.js version: 18.17.1 Typescript version: 5.1.3
No response
Yes, I have the time, and I know how to start.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Issue description
When I use subqueries and pagination I get the error Cannot get entity metadata for the given alias ...
Expected Behavior
List of entities
Actual Behavior
TypeORMError: Cannot get entity metadata for the given alias ....
Steps to reproduce
`@Entity()
export class T1 {
}
`
`
@entity()
export class T2 {
}`
const data = await qb.getManyAndCount();
Without take(10).skip(0) everything works fine.
I know that t1 can be added without a subquery.
This example is for demonstration purposes.
My Environment
Typeorm: 0.3.20
Operating System: Linix
Node.js version: 18.17.1
Typescript version: 5.1.3
Additional Context
No response
Relevant Database Driver(s)
Are you willing to resolve this issue by submitting a Pull Request?
Yes, I have the time, and I know how to start.
The text was updated successfully, but these errors were encountered: