added cascadesAll option

This commit is contained in:
Umed Khudoiberdiev 2016-05-01 14:24:20 +05:00
parent 27b9dabefc
commit 83e89a1352
2 changed files with 12 additions and 6 deletions

View File

@ -121,12 +121,12 @@ export class RelationMetadata extends PropertyMetadata {
if (args.options.name)
this._name = args.options.name;
if (args.options.cascadeInsert)
this.isCascadeInsert = args.options.cascadeInsert;
if (args.options.cascadeUpdate)
this.isCascadeUpdate = args.options.cascadeUpdate;
if (args.options.cascadeRemove)
this.isCascadeRemove = args.options.cascadeRemove;
if (args.options.cascadeInsert || args.options.cascadeAll)
this.isCascadeInsert = true;
if (args.options.cascadeUpdate || args.options.cascadeAll)
this.isCascadeUpdate = true;
if (args.options.cascadeRemove || args.options.cascadeAll)
this.isCascadeRemove = true;
if (args.options.oldColumnName)
this.oldColumnName = args.options.oldColumnName;
if (args.options.nullable)

View File

@ -10,6 +10,12 @@ export interface RelationOptions {
*/
name?: string;
/**
* If set to true then it means that related object can be allowed to be inserted / updated / removed to the db.
* This is option a shortcut if you would like to set cascadeInsert, cascadeUpdate and cascadeRemove to true.
*/
cascadeAll?: boolean;
/**
* If set to true then it means that related object can be allowed to be inserted to the db.
*/