UNPKG

3.4 kBSource Map (JSON)View Raw
1{"version":3,"sources":["../../src/entity-schema/EntitySchemaRelationOptions.ts"],"names":[],"mappings":"","file":"EntitySchemaRelationOptions.js","sourcesContent":["import {JoinColumnOptions} from \"../decorator/options/JoinColumnOptions\";\nimport {RelationType} from \"../metadata/types/RelationTypes\";\nimport {JoinTableMultipleColumnsOptions} from \"../decorator/options/JoinTableMultipleColumnsOptions\";\nimport {DeferrableType} from \"../metadata/types/DeferrableType\";\nimport {OnDeleteType} from \"../metadata/types/OnDeleteType\";\nimport {OnUpdateType} from \"../metadata/types/OnUpdateType\";\nimport {JoinTableOptions} from \"../index\";\n\nexport interface EntitySchemaRelationOptions {\n\n /**\n * Indicates with which entity this relation is made.\n */\n target: Function|string;\n\n /**\n * Type of relation. Can be one of the value of the RelationTypes class.\n */\n type: RelationType;\n\n /**\n * Inverse side of the relation.\n */\n inverseSide?: string;\n\n /**\n * Indicates if this relation will be lazily loaded.\n */\n lazy?: boolean;\n\n /**\n * Indicates if this relation will be eagerly loaded.\n */\n eager?: boolean;\n\n /**\n * Indicates if persistence is enabled for the relation.\n * By default its enabled, but if you want to avoid any changes in the relation to be reflected in the database you can disable it.\n * If its disabled you can only change a relation from inverse side of a relation or using relation query builder functionality.\n * This is useful for performance optimization since its disabling avoid multiple extra queries during entity save.\n */\n persistence?: boolean;\n\n /**\n * Indicates if this relation will be a primary key.\n * Can be used only for many-to-one and owner one-to-one relations.\n */\n primary?: boolean;\n\n /**\n * Join table options of this column. If set to true then it simply means that it has a join table.\n */\n joinTable?: boolean|JoinTableOptions|JoinTableMultipleColumnsOptions;\n\n /**\n * Join column options of this column. If set to true then it simply means that it has a join column.\n */\n joinColumn?: boolean|JoinColumnOptions;\n\n /**\n * Indicates if this is a parent (can be only many-to-one relation) relation in the tree tables.\n */\n treeParent?: boolean;\n\n /**\n * Indicates if this is a children (can be only one-to-many relation) relation in the tree tables.\n */\n treeChildren?: boolean;\n\n /**\n * If set to true then it means that related object can be allowed to be inserted / updated / removed to the db.\n * This is option a shortcut if you would like to set cascadeInsert, cascadeUpdate and cascadeRemove to true.\n */\n cascade?: boolean|(\"insert\"|\"update\"|\"remove\")[];\n\n /**\n * Default database value.\n */\n default?: any;\n\n /**\n * Indicates if relation column value can be nullable or not.\n */\n nullable?: boolean;\n\n /**\n * Database cascade action on delete.\n */\n onDelete?: OnDeleteType;\n\n /**\n * Database cascade action on update.\n */\n onUpdate?: OnUpdateType;\n\n /**\n * Indicate if foreign key constraints can be deferred.\n */\n deferrable?: DeferrableType;\n\n}\n"],"sourceRoot":".."}
\No newline at end of file