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
Describe the bug The following code generates incorrect SQL
const query = em.qb(TestB,'b') .leftJoin('b.a','a') .select(['b.*','a.name']) .getQuery(); console.debug(query);
select `b`.*, `b`.`name` from `test_b` as `b` left join `test_a` as `a` on `b`.`a_id` = `a`.`id`
Instead of a.name , the SQL is generated with b.name. Here a.name is from an embedded entity with prefix set to false.
a
name
b
To Reproduce Steps to reproduce the behavior:
Below are the entity definitions.
@Embeddable() class TestNamedEntity { @Property({ length: 100 }) name!: string; @Property({ length: 250 }) description!: string; } @Entity() class TestA { @PrimaryKey() id: number; @Embedded({ prefix: false }) identity: TestNamedEntity; } @Entity() class TestB { @PrimaryKey() id: string; @ManyToOne('TestA',{ cascade: [] }) a?: Ref<TestA>; }
Expected behavior The SQL should be
select `b`.*, `a`.`name` from `test_b` as `b` left join `test_a` as `a` on `b`.`a_id` = `a`.`id`
Additional context This happens with prefix = false.
Versions
The text was updated successfully, but these errors were encountered:
24c4ece
No branches or pull requests
Describe the bug
The following code generates incorrect SQL
Instead of
a
.name
, the SQL is generated withb
.name
. Here a.name is from an embedded entity with prefix set to false.To Reproduce
Steps to reproduce the behavior:
Below are the entity definitions.
Expected behavior
The SQL should be
Additional context
This happens with prefix = false.
Versions
The text was updated successfully, but these errors were encountered: