Skip to content
New issue

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

fix: condition is optional in SelectQueryBuilder joins #7888

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
34 changes: 17 additions & 17 deletions src/query-builder/SelectQueryBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements
* You also need to specify an alias of the joined data.
* Optionally, you can add condition and parameters used in condition.
*/
innerJoin(entityOrProperty: Function|string|((qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>), alias: string, condition: string = "", parameters?: ObjectLiteral): this {
innerJoin(entityOrProperty: Function|string|((qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>), alias: string, condition?: string, parameters?: ObjectLiteral): this {
this.join("INNER", entityOrProperty, alias, condition, parameters);
return this;
}
Expand Down Expand Up @@ -311,7 +311,7 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements
* You also need to specify an alias of the joined data.
* Optionally, you can add condition and parameters used in condition.
*/
leftJoin(entityOrProperty: Function|string|((qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>), alias: string, condition: string = "", parameters?: ObjectLiteral): this {
leftJoin(entityOrProperty: Function|string|((qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>), alias: string, condition?: string, parameters?: ObjectLiteral): this {
this.join("LEFT", entityOrProperty, alias, condition, parameters);
return this;
}
Expand Down Expand Up @@ -350,7 +350,7 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements
* You also need to specify an alias of the joined data.
* Optionally, you can add condition and parameters used in condition.
*/
innerJoinAndSelect(entityOrProperty: Function|string|((qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>), alias: string, condition: string = "", parameters?: ObjectLiteral): this {
innerJoinAndSelect(entityOrProperty: Function|string|((qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>), alias: string, condition?: string, parameters?: ObjectLiteral): this {
this.addSelect(alias);
this.innerJoin(entityOrProperty, alias, condition, parameters);
return this;
Expand All @@ -376,7 +376,7 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements
* You also need to specify an alias of the joined data.
* Optionally, you can add condition and parameters used in condition.
*/
leftJoinAndSelect(entity: Function|string, alias: string, condition: string, parameters?: ObjectLiteral): this;
leftJoinAndSelect(entity: Function|string, alias: string, condition?: string, parameters?: ObjectLiteral): this;

/**
* LEFT JOINs table and adds all selection properties to SELECT.
Expand All @@ -390,7 +390,7 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements
* You also need to specify an alias of the joined data.
* Optionally, you can add condition and parameters used in condition.
*/
leftJoinAndSelect(entityOrProperty: Function|string|((qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>), alias: string, condition: string = "", parameters?: ObjectLiteral): this {
leftJoinAndSelect(entityOrProperty: Function|string|((qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>), alias: string, condition?: string, parameters?: ObjectLiteral): this {
this.addSelect(alias);
this.leftJoin(entityOrProperty, alias, condition, parameters);
return this;
Expand Down Expand Up @@ -423,7 +423,7 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements
* You also need to specify an alias of the joined data.
* Optionally, you can add condition and parameters used in condition.
*/
innerJoinAndMapMany(mapToProperty: string, entity: Function|string, alias: string, condition: string, parameters?: ObjectLiteral): this;
innerJoinAndMapMany(mapToProperty: string, entity: Function|string, alias: string, condition?: string, parameters?: ObjectLiteral): this;

/**
* INNER JOINs table, SELECTs the data returned by a join and MAPs all that data to some entity's property.
Expand All @@ -432,7 +432,7 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements
* You also need to specify an alias of the joined data.
* Optionally, you can add condition and parameters used in condition.
*/
innerJoinAndMapMany(mapToProperty: string, tableName: string, alias: string, condition: string, parameters?: ObjectLiteral): this;
innerJoinAndMapMany(mapToProperty: string, tableName: string, alias: string, condition?: string, parameters?: ObjectLiteral): this;

/**
* INNER JOINs, SELECTs the data returned by a join and MAPs all that data to some entity's property.
Expand All @@ -441,7 +441,7 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements
* You also need to specify an alias of the joined data.
* Optionally, you can add condition and parameters used in condition.
*/
innerJoinAndMapMany(mapToProperty: string, entityOrProperty: Function|string|((qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>), alias: string, condition: string = "", parameters?: ObjectLiteral): this {
innerJoinAndMapMany(mapToProperty: string, entityOrProperty: Function|string|((qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>), alias: string, condition?: string, parameters?: ObjectLiteral): this {
this.addSelect(alias);
this.join("INNER", entityOrProperty, alias, condition, parameters, mapToProperty, true);
return this;
Expand Down Expand Up @@ -474,7 +474,7 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements
* You also need to specify an alias of the joined data.
* Optionally, you can add condition and parameters used in condition.
*/
innerJoinAndMapOne(mapToProperty: string, entity: Function|string, alias: string, condition: string, parameters?: ObjectLiteral): this;
innerJoinAndMapOne(mapToProperty: string, entity: Function|string, alias: string, condition?: string, parameters?: ObjectLiteral): this;

/**
* INNER JOINs table, SELECTs the data returned by a join and MAPs all that data to some entity's property.
Expand All @@ -483,7 +483,7 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements
* You also need to specify an alias of the joined data.
* Optionally, you can add condition and parameters used in condition.
*/
innerJoinAndMapOne(mapToProperty: string, tableName: string, alias: string, condition: string, parameters?: ObjectLiteral): this;
innerJoinAndMapOne(mapToProperty: string, tableName: string, alias: string, condition?: string, parameters?: ObjectLiteral): this;

/**
* INNER JOINs, SELECTs the data returned by a join and MAPs all that data to some entity's property.
Expand All @@ -492,7 +492,7 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements
* You also need to specify an alias of the joined data.
* Optionally, you can add condition and parameters used in condition.
*/
innerJoinAndMapOne(mapToProperty: string, entityOrProperty: Function|string|((qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>), alias: string, condition: string = "", parameters?: ObjectLiteral): this {
innerJoinAndMapOne(mapToProperty: string, entityOrProperty: Function|string|((qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>), alias: string, condition?: string, parameters?: ObjectLiteral): this {
this.addSelect(alias);
this.join("INNER", entityOrProperty, alias, condition, parameters, mapToProperty, false);
return this;
Expand Down Expand Up @@ -525,7 +525,7 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements
* You also need to specify an alias of the joined data.
* Optionally, you can add condition and parameters used in condition.
*/
leftJoinAndMapMany(mapToProperty: string, entity: Function|string, alias: string, condition: string, parameters?: ObjectLiteral): this;
leftJoinAndMapMany(mapToProperty: string, entity: Function|string, alias: string, condition?: string, parameters?: ObjectLiteral): this;

/**
* LEFT JOINs table, SELECTs the data returned by a join and MAPs all that data to some entity's property.
Expand All @@ -534,7 +534,7 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements
* You also need to specify an alias of the joined data.
* Optionally, you can add condition and parameters used in condition.
*/
leftJoinAndMapMany(mapToProperty: string, tableName: string, alias: string, condition: string, parameters?: ObjectLiteral): this;
leftJoinAndMapMany(mapToProperty: string, tableName: string, alias: string, condition?: string, parameters?: ObjectLiteral): this;

/**
* LEFT JOINs, SELECTs the data returned by a join and MAPs all that data to some entity's property.
Expand All @@ -543,7 +543,7 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements
* You also need to specify an alias of the joined data.
* Optionally, you can add condition and parameters used in condition.
*/
leftJoinAndMapMany(mapToProperty: string, entityOrProperty: Function|string|((qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>), alias: string, condition: string = "", parameters?: ObjectLiteral): this {
leftJoinAndMapMany(mapToProperty: string, entityOrProperty: Function|string|((qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>), alias: string, condition?: string, parameters?: ObjectLiteral): this {
this.addSelect(alias);
this.join("LEFT", entityOrProperty, alias, condition, parameters, mapToProperty, true);
return this;
Expand Down Expand Up @@ -576,7 +576,7 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements
* You also need to specify an alias of the joined data.
* Optionally, you can add condition and parameters used in condition.
*/
leftJoinAndMapOne(mapToProperty: string, entity: Function|string, alias: string, condition: string, parameters?: ObjectLiteral): this;
leftJoinAndMapOne(mapToProperty: string, entity: Function|string, alias: string, condition?: string, parameters?: ObjectLiteral): this;

/**
* LEFT JOINs table, SELECTs the data returned by a join and MAPs all that data to some entity's property.
Expand All @@ -585,7 +585,7 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements
* You also need to specify an alias of the joined data.
* Optionally, you can add condition and parameters used in condition.
*/
leftJoinAndMapOne(mapToProperty: string, tableName: string, alias: string, condition: string, parameters?: ObjectLiteral): this;
leftJoinAndMapOne(mapToProperty: string, tableName: string, alias: string, condition?: string, parameters?: ObjectLiteral): this;

/**
* LEFT JOINs, SELECTs the data returned by a join and MAPs all that data to some entity's property.
Expand All @@ -594,7 +594,7 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements
* You also need to specify an alias of the joined data.
* Optionally, you can add condition and parameters used in condition.
*/
leftJoinAndMapOne(mapToProperty: string, entityOrProperty: Function|string|((qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>), alias: string, condition: string = "", parameters?: ObjectLiteral): this {
leftJoinAndMapOne(mapToProperty: string, entityOrProperty: Function|string|((qb: SelectQueryBuilder<any>) => SelectQueryBuilder<any>), alias: string, condition?: string, parameters?: ObjectLiteral): this {
this.addSelect(alias);
this.join("LEFT", entityOrProperty, alias, condition, parameters, mapToProperty, false);
return this;
Expand Down