mirror of
https://github.com/typeorm/typeorm.git
synced 2025-12-08 21:26:23 +00:00
fixed issue in qb
This commit is contained in:
parent
c3e69b952a
commit
fa60671819
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "typeorm",
|
||||
"private": true,
|
||||
"version": "0.0.2-alpha.27",
|
||||
"version": "0.0.2-alpha.28",
|
||||
"description": "Data-mapper ORM for Typescript",
|
||||
"license": "Apache-2.0",
|
||||
"readmeFilename": "README.md",
|
||||
|
||||
@ -665,7 +665,7 @@ export class QueryBuilder<Entity> {
|
||||
|
||||
} else if (relation.isOneToMany || (relation.isOneToOne && !relation.isOwning)) {
|
||||
const joinTableColumn = relation.inverseRelation.joinColumn.referencedColumn.name;
|
||||
const condition = join.alias.name + "." + relation.inverseSideProperty + "=" + parentAlias + "." + joinTableColumn;
|
||||
const condition = join.alias.name + "." + relation.inverseRelation.name + "=" + parentAlias + "." + joinTableColumn;
|
||||
return " " + joinType + " JOIN " + joinTableName + " " + join.alias.name + " " + join.conditionType + " " + condition + appendedCondition;
|
||||
|
||||
} else {
|
||||
|
||||
@ -98,7 +98,7 @@ describe("persistence > custom-column-names", function() {
|
||||
// load a post
|
||||
before(function() {
|
||||
return postRepository
|
||||
.findOneById(1, { alias: "post", leftJoinAndSelect: { category: "post.categoryId" } })
|
||||
.findOneById(1, { alias: "post", leftJoinAndSelect: { category: "post.category" } })
|
||||
.then(post => loadedPost = post);
|
||||
});
|
||||
|
||||
@ -133,7 +133,7 @@ describe("persistence > custom-column-names", function() {
|
||||
// load a post
|
||||
before(function() {
|
||||
return postRepository
|
||||
.findOneById(1, { alias: "post", leftJoinAndSelect: { category: "post.categoryId" } })
|
||||
.findOneById(1, { alias: "post", leftJoinAndSelect: { category: "post.category" } })
|
||||
.then(post => loadedPost = post);
|
||||
});
|
||||
|
||||
@ -163,7 +163,7 @@ describe("persistence > custom-column-names", function() {
|
||||
// load a post
|
||||
before(function() {
|
||||
return postRepository
|
||||
.findOneById(1, { alias: "post", leftJoinAndSelect: { category: "post.categoryId" } })
|
||||
.findOneById(1, { alias: "post", leftJoinAndSelect: { category: "post.category" } })
|
||||
.then(post => loadedPost = post);
|
||||
});
|
||||
|
||||
@ -211,7 +211,7 @@ describe("persistence > custom-column-names", function() {
|
||||
// load a post
|
||||
before(function() {
|
||||
return postRepository
|
||||
.findOneById(1, { alias: "post", leftJoinAndSelect: { category: "post.categoryId", metadata: "category.metadataId" } })
|
||||
.findOneById(1, { alias: "post", leftJoinAndSelect: { category: "post.category", metadata: "category.metadata" } })
|
||||
.then(post => loadedPost = post);
|
||||
});
|
||||
|
||||
@ -256,7 +256,7 @@ describe("persistence > custom-column-names", function() {
|
||||
// load a post
|
||||
before(function() {
|
||||
return postRepository
|
||||
.findOneById(1, { alias: "post", leftJoinAndSelect: { category: "post.categoryId", metadata: "category.metadataId" } })
|
||||
.findOneById(1, { alias: "post", leftJoinAndSelect: { category: "post.category", metadata: "category.metadata" } })
|
||||
.then(post => loadedPost = post);
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user