Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added @DeleteDateColumn * updated test for embedded-with-special-columns * added the softDelete and restore methods to QueryBuilder * added test for query builder > soft-delete * added the softDelete and restore methods to repository * added test for repository > soft-delete and restore * added the softRemove and recover methods to repository * added test for repository > soft-remove and recover * fixed the title of the test for repository > soft-delete * added the support of the cascades soft-remove and recover * added test: support of the cascades soft-remove and recover * fixed test for should perform restory with limit correctly: missing applying the limit method * fixed the wrong comment for recover operation * added the global condition of non-deleted to query-builder for the entity with delete date columns * added the global condition of non-deleted to repository for the entity with delete date columns * updated test for the global condition of non-deleted * added the test for soft-delete and restore properties inside embeds as well * added test to query-builder for the global condition of non-deleted * updated test to repository for the global condition of non-deleted * added test to repository for the global condition of non-deleted * fixed comment for the test 'find with the global condition of non-deleted and eager relation' * fixed can't add the corrent global condition as the missing of aliasNamePrefix * fixed can't get the correct result as the missing of the ordering by id * fixed should use propertyName instead of databaseName * added deleteDate and deleteDateNullable for sap
- Loading branch information
Showing
63 changed files
with
2,332 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { ColumnOptions, getMetadataArgsStorage } from "../../"; | ||
import { ColumnMetadataArgs } from "../../metadata-args/ColumnMetadataArgs"; | ||
|
||
/** | ||
* This column will store a delete date of the soft-deleted object. | ||
* This date is being updated each time you soft-delete the object. | ||
*/ | ||
export function DeleteDateColumn(options?: ColumnOptions): Function { | ||
return function(object: Object, propertyName: string) { | ||
getMetadataArgsStorage().columns.push({ | ||
target: object.constructor, | ||
propertyName: propertyName, | ||
mode: "deleteDate", | ||
options: options || {} | ||
} as ColumnMetadataArgs); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import {EntityMetadata} from "../metadata/EntityMetadata"; | ||
|
||
/** | ||
*/ | ||
export class MissingDeleteDateColumnError extends Error { | ||
name = "MissingDeleteDateColumnError"; | ||
|
||
constructor(entityMetadata: EntityMetadata) { | ||
super(); | ||
Object.setPrototypeOf(this, MissingDeleteDateColumnError.prototype); | ||
this.message = `Entity "${entityMetadata.name}" does not have delete date columns.`; | ||
} | ||
|
||
} |
Oops, something went wrong.