Skip to content

Commit

Permalink
deprecate setLock in favour of lockMode
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkdave committed Nov 19, 2019
1 parent 6456533 commit d2c9b03
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion src/query-builder/SelectQueryBuilder.ts
Expand Up @@ -947,27 +947,56 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements

/**
* Sets locking mode.
*
* @deprecated Use `lockMode`
*/
setLock(lockMode: "optimistic", lockVersion: number): this;

/**
* Sets locking mode.
*
* @deprecated Use `lockMode`
*/
setLock(lockMode: "optimistic", lockVersion: Date): this;

/**
* Sets locking mode.
*
* @deprecated Use `lockMode`
*/
setLock(lockMode: "pessimistic_read"|"pessimistic_write"|"dirty_read"): this;

/**
* Sets locking mode.
*
* @deprecated Use `lockMode`
*/
setLock(lockMode: "optimistic"|"pessimistic_read"|"pessimistic_write"|"dirty_read", lockVersion?: number|Date): this {
return this.lockMode(lockMode as any, lockVersion as any);
}

/**
* Sets locking mode.
*/
lockMode(lockMode: "optimistic", lockVersion: number): this;

/**
* Sets locking mode.
*/
lockMode(lockMode: "optimistic", lockVersion: Date): this;

/**
* Sets locking mode.
*/
lockMode(lockMode: "pessimistic_read"|"pessimistic_write"|"dirty_read"): this;

/**
* Sets locking mode.
*/
lockMode(lockMode: "optimistic"|"pessimistic_read"|"pessimistic_write"|"dirty_read", lockVersion?: number|Date): this {
this.expressionMap.lockMode = lockMode;
this.expressionMap.lockVersion = lockVersion;
return this;

}

/**
Expand Down

0 comments on commit d2c9b03

Please sign in to comment.