Class: abstract BaseTrackedEntityHelper
typeorm/src.BaseTrackedEntityHelper
Extends
Implements
Constructors
new BaseTrackedEntityHelper()
new BaseTrackedEntityHelper():
BaseTrackedEntityHelper
Returns
Inherited from
Properties
createdAt
createdAt:
Date
Implementation of
Source
libs/typeorm/src/lib/entity/entity-helper.ts:28
deletedAt
deletedAt?:
Date
Implementation of
Source
libs/typeorm/src/lib/entity/entity-helper.ts:48
updatedAt
updatedAt:
Date
Implementation of
Source
libs/typeorm/src/lib/entity/entity-helper.ts:38
Accessors
target
getstatictarget():EntityTarget<any>
Returns object that is managed by this repository. If this repository manages entity from schema, then it returns a name of that schema instead.
Returns
EntityTarget<any>
Source
node_modules/typeorm/repository/BaseEntity.d.ts:67
Methods
hasId
hasId():
boolean
Checks if entity has an id. If entity composite compose ids, it will check them all.
Returns
boolean
Inherited from
Source
node_modules/typeorm/repository/BaseEntity.d.ts:30
recover
recover(
options?):Promise<BaseTrackedEntityHelper>
Recovers a given entity in the database.
Parameters
▪ options?: SaveOptions
Returns
Promise<BaseTrackedEntityHelper>
Inherited from
Source
node_modules/typeorm/repository/BaseEntity.d.ts:47
reload
reload():
Promise<void>
Reloads entity data from the database.
Returns
Promise<void>
Inherited from
Source
node_modules/typeorm/repository/BaseEntity.d.ts:51
remove
remove(
options?):Promise<BaseTrackedEntityHelper>
Removes current entity from the database.
Parameters
▪ options?: RemoveOptions
Returns
Promise<BaseTrackedEntityHelper>
Inherited from
Source
node_modules/typeorm/repository/BaseEntity.d.ts:39
save
save(
options?):Promise<BaseTrackedEntityHelper>
Saves current entity in the database. If entity does not exist in the database then inserts, otherwise updates.
Parameters
▪ options?: SaveOptions
Returns
Promise<BaseTrackedEntityHelper>
Inherited from
Source
node_modules/typeorm/repository/BaseEntity.d.ts:35
softRemove
softRemove(
options?):Promise<BaseTrackedEntityHelper>
Records the delete date of current entity.
Parameters
▪ options?: SaveOptions
Returns
Promise<BaseTrackedEntityHelper>
Inherited from
Source
node_modules/typeorm/repository/BaseEntity.d.ts:43
average
staticaverage<T>(this,columnName,where):Promise<number>
Return the AVG of a column
Type parameters
▪ T extends BaseEntity
Parameters
▪ this: () => T & typeof BaseEntity
▪ columnName: PickKeysByType<T, number>
▪ where: FindOptionsWhere<T>
Returns
Promise<number>
Inherited from
Source
node_modules/typeorm/repository/BaseEntity.d.ts:217
clear
staticclear<T>(this):Promise<void>
Clears all the data from the given table/collection (truncates/drops it).
Type parameters
▪ T extends BaseEntity
Parameters
▪ this: () => T & typeof BaseEntity
Returns
Promise<void>
Inherited from
Source
node_modules/typeorm/repository/BaseEntity.d.ts:319
count
staticcount<T>(this,options?):Promise<number>
Counts entities that match given options.
Type parameters
▪ T extends BaseEntity
Parameters
▪ this: () => T & typeof BaseEntity
▪ options?: FindManyOptions<T>
Returns
Promise<number>
Inherited from
Source
node_modules/typeorm/repository/BaseEntity.d.ts:199
countBy
staticcountBy<T>(this,where):Promise<number>
Counts entities that match given WHERE conditions.
Type parameters
▪ T extends BaseEntity
Parameters
▪ this: () => T & typeof BaseEntity
▪ where: FindOptionsWhere<T>
Returns
Promise<number>
Inherited from
Source
node_modules/typeorm/repository/BaseEntity.d.ts:205
create
create(this)
staticcreate<T>(this):T
Creates a new entity instance.
Type parameters
▪ T extends BaseEntity
Parameters
▪ this: () => T & typeof BaseEntity
Returns
T
Inherited from
Source
node_modules/typeorm/repository/BaseEntity.d.ts:88
create(this, entityLikeArray)
staticcreate<T>(this,entityLikeArray):T[]
Creates a new entities and copies all entity properties from given objects into their new entities. Note that it copies only properties that present in entity schema.
Type parameters
▪ T extends BaseEntity
Parameters
▪ this: () => T & typeof BaseEntity
▪ entityLikeArray: DeepPartial<T>[]
Returns
T[]
Inherited from
Source
node_modules/typeorm/repository/BaseEntity.d.ts:95
create(this, entityLike)
staticcreate<T>(this,entityLike):T
Creates a new entity instance and copies all entity properties from this object into a new entity. Note that it copies only properties that present in entity schema.
Type parameters
▪ T extends BaseEntity
Parameters
▪ this: () => T & typeof BaseEntity
▪ entityLike: DeepPartial<T>
Returns
T
Inherited from
Source
node_modules/typeorm/repository/BaseEntity.d.ts:102
createQueryBuilder
staticcreateQueryBuilder<T>(this,alias?):SelectQueryBuilder<T>
Creates a new query builder that can be used to build a SQL query.
Type parameters
▪ T extends BaseEntity
Parameters
▪ this: () => T & typeof BaseEntity
▪ alias?: string
Returns
SelectQueryBuilder<T>
Inherited from
EntityHelper.createQueryBuilder
Source
node_modules/typeorm/repository/BaseEntity.d.ts:82
delete
staticdelete<T>(this,criteria):Promise<DeleteResult>
Deletes entities by a given criteria. Unlike remove method executes a primitive operation without cascades, relations and other operations included. Executes fast and efficient DELETE query. Does not check if entity exist in the database.
Type parameters
▪ T extends BaseEntity
Parameters
▪ this: () => T & typeof BaseEntity
▪ criteria: string | number | string[] | number[] | Date | ObjectId | Date[] | ObjectId[] | FindOptionsWhere<T>
Returns
Promise<DeleteResult>
Inherited from
Source
node_modules/typeorm/repository/BaseEntity.d.ts:193
find
staticfind<T>(this,options?):Promise<T[]>
Finds entities that match given options.
Type parameters
▪ T extends BaseEntity
Parameters
▪ this: () => T & typeof BaseEntity
▪ options?: FindManyOptions<T>
Returns
Promise<T[]>
Inherited from
Source
node_modules/typeorm/repository/BaseEntity.d.ts:235
findAndCount
staticfindAndCount<T>(this,options?):Promise<[T[],number]>
Finds entities that match given find options. Also counts all entities that match given conditions, but ignores pagination settings (from and take options).
Type parameters
▪ T extends BaseEntity
Parameters
▪ this: () => T & typeof BaseEntity
▪ options?: FindManyOptions<T>
Returns
Promise<[T[], number]>
Inherited from
Source
node_modules/typeorm/repository/BaseEntity.d.ts:249
findAndCountBy
staticfindAndCountBy<T>(this,where):Promise<[T[],number]>
Finds entities that match given WHERE conditions. Also counts all entities that match given conditions, but ignores pagination settings (from and take options).
Type parameters
▪ T extends BaseEntity
Parameters
▪ this: () => T & typeof BaseEntity
▪ where: FindOptionsWhere<T>
Returns
Promise<[T[], number]>
Inherited from
Source
node_modules/typeorm/repository/BaseEntity.d.ts:257
findBy
staticfindBy<T>(this,where):Promise<T[]>
Finds entities that match given WHERE conditions.
Type parameters
▪ T extends BaseEntity
Parameters
▪ this: () => T & typeof BaseEntity
▪ where: FindOptionsWhere<T>
Returns
Promise<T[]>
Inherited from
Source
node_modules/typeorm/repository/BaseEntity.d.ts:241
findByIds
staticfindByIds<T>(this,ids):Promise<T[]>
Finds entities by ids. Optionally find options can be applied.
Type parameters
▪ T extends BaseEntity
Parameters
▪ this: () => T & typeof BaseEntity
▪ ids: any[]
Returns
Promise<T[]>
Inherited from
Deprecated
use findBy method instead in conjunction with In operator, for example:
.findBy({ id: In([1, 2, 3]) })
Source
node_modules/typeorm/repository/BaseEntity.d.ts:270
findOne
staticfindOne<T>(this,options):Promise<T>
Finds first entity that matches given conditions.
Type parameters
▪ T extends BaseEntity
Parameters
▪ this: () => T & typeof BaseEntity
▪ options: FindOneOptions<T>
Returns
Promise<T>
Inherited from
Source
node_modules/typeorm/repository/BaseEntity.d.ts:276
findOneBy
staticfindOneBy<T>(this,where):Promise<T>
Finds first entity that matches given conditions.
Type parameters
▪ T extends BaseEntity
Parameters
▪ this: () => T & typeof BaseEntity
▪ where: FindOptionsWhere<T>
Returns
Promise<T>
Inherited from
Source
node_modules/typeorm/repository/BaseEntity.d.ts:282
findOneById
staticfindOneById<T>(this,id):Promise<T>
Finds first entity that matches given options.
Type parameters
▪ T extends BaseEntity
Parameters
▪ this: () => T & typeof BaseEntity
▪ id: string | number | Date | ObjectId
Returns
Promise<T>
Inherited from
Deprecated
use findOneBy method instead in conjunction with In operator, for example:
.findOneBy({ id: 1 // where "id" is your primary column name })
Source
node_modules/typeorm/repository/BaseEntity.d.ts:294
findOneByOrFail
staticfindOneByOrFail<T>(this,where):Promise<T>
Finds first entity that matches given conditions.
Type parameters
▪ T extends BaseEntity
Parameters
▪ this: () => T & typeof BaseEntity
▪ where: FindOptionsWhere<T>
Returns
Promise<T>
Inherited from
Source
node_modules/typeorm/repository/BaseEntity.d.ts:306
findOneOrFail
staticfindOneOrFail<T>(this,options):Promise<T>
Finds first entity that matches given conditions.
Type parameters
▪ T extends BaseEntity
Parameters
▪ this: () => T & typeof BaseEntity
▪ options: FindOneOptions<T>
Returns
Promise<T>
Inherited from
Source
node_modules/typeorm/repository/BaseEntity.d.ts:300
getId
staticgetId<T>(this,entity):any
Gets entity mixed id.
Type parameters
▪ T extends BaseEntity
Parameters
▪ this: () => T & typeof BaseEntity
▪ entity: T
Returns
any
Inherited from
Source
node_modules/typeorm/repository/BaseEntity.d.ts:76
getRepository
staticgetRepository<T>(this):Repository<T>
Gets current entity's Repository.
Type parameters
▪ T extends BaseEntity
Parameters
▪ this: () => T & typeof BaseEntity
Returns
Repository<T>
Inherited from
Source
node_modules/typeorm/repository/BaseEntity.d.ts:59
hasId
statichasId(entity):boolean
Checks entity has an id. If entity composite compose ids, it will check them all.
Parameters
▪ entity: BaseEntity
Returns
boolean
Inherited from
Source
node_modules/typeorm/repository/BaseEntity.d.ts:72
insert
staticinsert<T>(this,entity):Promise<InsertResult>
Inserts a given entity into the database. Unlike save method executes a primitive operation without cascades, relations and other operations included. Executes fast and efficient INSERT query. Does not check if entity exist in the database, so query will fail if duplicate entity is being inserted.
Type parameters
▪ T extends BaseEntity
Parameters
▪ this: () => T & typeof BaseEntity
▪ entity: _QueryDeepPartialEntity<ObjectLiteral extends T ? unknown : T> | _QueryDeepPartialEntity<ObjectLiteral extends T ? unknown : T>[]
Returns
Promise<InsertResult>
Inherited from
Source
node_modules/typeorm/repository/BaseEntity.d.ts:167
maximum
staticmaximum<T>(this,columnName,where):Promise<number>
Return the MAX of a column
Type parameters
▪ T extends BaseEntity
Parameters
▪ this: () => T & typeof BaseEntity
▪ columnName: PickKeysByType<T, number>
▪ where: FindOptionsWhere<T>
Returns
Promise<number>
Inherited from
Source
node_modules/typeorm/repository/BaseEntity.d.ts:229