added todos to specific repo

This commit is contained in:
Umed Khudoiberdiev 2017-06-21 11:28:30 +05:00
parent e952161f41
commit 6766440681
2 changed files with 15 additions and 0 deletions

View File

@ -200,6 +200,8 @@ export class Repository<Entity extends ObjectLiteral> {
/**
* Removes entity by a given entity id.
*
* todo: create removeByIds method ?
*/
async removeById(id: any, options?: RemoveOptions): Promise<void> {
return this.manager.removeById(this.metadata.target, id, options);

View File

@ -11,6 +11,15 @@ import {QueryRunner} from "../query-runner/QueryRunner";
* Repository for more specific operations.
*
* @deprecated Don't use it yet
*
* todo: most of these methods looks like can be part of query builder functionality
* todo: maybe instead of SpecificRepository we should have SpecificQueryBuilder? (better name needed)
* todo: it can be used like createQueryBuilder().specific().setRelation
* todo: or maybe split specific into multiple different purpose QueryBuilders ? For example RelationQueryBuilder
* todo: with methods like createQueryBuilder().relation(Post, "categories").set(value).add(value).remove(value)
* todo: add and remove for many-to-many, set for many-to-one and value can be entity or simply entity id or id map
* todo: also createQueryBuilder().relation(Post, "categories").getIdsOf(postIds)
* todo: also createQueryBuilder().relation(Post, "categories").getCountOf(postIds)
*/
export class SpecificRepository<Entity extends ObjectLiteral> {
@ -369,6 +378,8 @@ export class SpecificRepository<Entity extends ObjectLiteral> {
/**
* Removes entity with the given id.
* Note that event listeners and event subscribers won't work (and will not send any events) when using this operation.
*
* @deprecated use Repository#removeById method
*/
async removeById(id: any): Promise<void> {
const alias = this.metadata.tableName;
@ -397,6 +408,8 @@ export class SpecificRepository<Entity extends ObjectLiteral> {
/**
* Removes all entities with the given ids.
* Note that event listeners and event subscribers won't work (and will not send any events) when using this operation.
*
* @deprecated use Repository#removeById method
*/
async removeByIds(ids: any[]): Promise<void> {
const alias = this.metadata.tableName;